blob: d732610892b60c53b13ad1f1cebe3b0047f7d2b4 [file] [log] [blame]
Hyunsun Moon44aac662017-02-18 02:07:01 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon44aac662017-02-18 02:07:01 +09003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.openstacknetworking.api;
17
daniel park32b42202018-03-14 16:53:44 +090018import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
20import org.onlab.packet.VlanId;
21import org.openstack4j.model.network.ExternalGateway;
Hyunsun Moon44aac662017-02-18 02:07:01 +090022import org.openstack4j.model.network.Network;
23import org.openstack4j.model.network.Port;
daniel park32b42202018-03-14 16:53:44 +090024import org.openstack4j.model.network.Router;
Hyunsun Moon44aac662017-02-18 02:07:01 +090025import org.openstack4j.model.network.Subnet;
26
27/**
28 * Service for administering the inventory of OpenStack network, subnet and port.
29 */
Jian Li5a15fe62018-03-06 13:41:20 +090030public interface OpenstackNetworkAdminService extends OpenstackNetworkService {
Hyunsun Moon44aac662017-02-18 02:07:01 +090031
32 /**
33 * Creates a network with the given information.
34 *
35 * @param network the new network
36 */
37 void createNetwork(Network network);
38
39 /**
40 * Updates the network with the given information.
41 *
42 * @param network the updated network
43 */
44 void updateNetwork(Network network);
45
46 /**
47 * Removes the network with the given network id.
48 *
49 * @param networkId network id
50 */
51 void removeNetwork(String networkId);
52
53 /**
54 * Creates a subnet with the given information.
55 *
56 * @param subnet the new subnet
57 */
58 void createSubnet(Subnet subnet);
59
60 /**
61 * Updates a subnet with the given information.
62 *
63 * @param subnet the updated subnet
64 */
65 void updateSubnet(Subnet subnet);
66
67 /**
68 * Removes the subnet with the given subnet id.
69 *
70 * @param subnetId subnet id
71 */
72 void removeSubnet(String subnetId);
73
74 /**
75 * Creates a port with the given information.
76 *
77 * @param port the new port
78 */
79 void createPort(Port port);
80
81 /**
82 * Updates the port with the given information.
83 *
84 * @param port the updated port
85 */
86 void updatePort(Port port);
87
88 /**
89 * Removes the port with the given port id.
90 *
91 * @param portId port id
92 */
93 void removePort(String portId);
Hyunsun Moonc7219222017-03-27 11:05:59 +090094
95 /**
96 * Clears the existing network, subnet and port states.
97 */
98 void clear();
daniel park32b42202018-03-14 16:53:44 +090099
100 /**
101 * Derives external router mac address with supplied external gateway.
102 *
103 * @param externalGateway external gateway information
104 * @param router router which owns externalGateway
105 * @param vlanId vlan id of external network
106 */
Jian Li5ecfd1a2018-12-10 11:41:03 +0900107 void deriveExternalPeerRouterMac(ExternalGateway externalGateway,
108 Router router, VlanId vlanId);
daniel park32b42202018-03-14 16:53:44 +0900109
110 /**
111 * Deletes external router with supplied external gateway.
112 *
113 * @param externalGateway external gateway information
114 */
115 void deleteExternalPeerRouter(ExternalGateway externalGateway);
116
117 /**
118 * Deletes external router with supplied ip address.
119 *
120 * @param ipAddress ip address
121 */
122 void deleteExternalPeerRouter(String ipAddress);
123
124 /**
125 * Updates external router mac address with supplied ip address.
126 *
127 * @param ipAddress ip address
128 * @param macAddress mac address
129 */
130 void updateExternalPeerRouterMac(IpAddress ipAddress, MacAddress macAddress);
131
132 /**
133 * Updates external router vlan id with supplied ip address.
134 *
135 * @param ipAddress ip address
136 * @param vlanId vlan id
137 */
138 void updateExternalPeerRouterVlan(IpAddress ipAddress, VlanId vlanId);
139
140 /**
141 * Updates external router ith supplied ip address, mac address, vlan id.
142 *
143 * @param ipAddress ip address
144 * @param macAddress mac address
145 * @param vlanId vlan id
146 */
147 void updateExternalPeerRouter(IpAddress ipAddress, MacAddress macAddress, VlanId vlanId);
Hyunsun Moon44aac662017-02-18 02:07:01 +0900148}