blob: b560b8d42c4aa6942a018565d40a6fd1c79d4b3e [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 */
107 void deriveExternalPeerRouterMac(ExternalGateway externalGateway, Router router, VlanId vlanId);
108
109 /**
110 * Deletes external router with supplied external gateway.
111 *
112 * @param externalGateway external gateway information
113 */
114 void deleteExternalPeerRouter(ExternalGateway externalGateway);
115
116 /**
117 * Deletes external router with supplied ip address.
118 *
119 * @param ipAddress ip address
120 */
121 void deleteExternalPeerRouter(String ipAddress);
122
123 /**
124 * Updates external router mac address with supplied ip address.
125 *
126 * @param ipAddress ip address
127 * @param macAddress mac address
128 */
129 void updateExternalPeerRouterMac(IpAddress ipAddress, MacAddress macAddress);
130
131 /**
132 * Updates external router vlan id with supplied ip address.
133 *
134 * @param ipAddress ip address
135 * @param vlanId vlan id
136 */
137 void updateExternalPeerRouterVlan(IpAddress ipAddress, VlanId vlanId);
138
139 /**
140 * Updates external router ith supplied ip address, mac address, vlan id.
141 *
142 * @param ipAddress ip address
143 * @param macAddress mac address
144 * @param vlanId vlan id
145 */
146 void updateExternalPeerRouter(IpAddress ipAddress, MacAddress macAddress, VlanId vlanId);
Hyunsun Moon44aac662017-02-18 02:07:01 +0900147}