blob: 7ff07bf5e680c1845e83f178c0dabcece1187600 [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 parkb5817102018-02-15 00:18:51 +090018import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
20import org.onlab.packet.VlanId;
Hyunsun Moon44aac662017-02-18 02:07:01 +090021import org.onosproject.event.ListenerService;
daniel parkb5817102018-02-15 00:18:51 +090022import org.openstack4j.model.network.ExternalGateway;
Hyunsun Moon44aac662017-02-18 02:07:01 +090023import org.openstack4j.model.network.Network;
24import org.openstack4j.model.network.Port;
daniel parkb5817102018-02-15 00:18:51 +090025import org.openstack4j.model.network.Router;
Hyunsun Moon44aac662017-02-18 02:07:01 +090026import org.openstack4j.model.network.Subnet;
27
28import java.util.Set;
29
30/**
31 * Service for interacting with the inventory of OpenStack network and port.
32 */
33public interface OpenstackNetworkService
34 extends ListenerService<OpenstackNetworkEvent, OpenstackNetworkListener> {
35 /**
36 * Returns the network with the supplied network ID.
37 *
38 * @param networkId network id
39 * @return openstack network
40 */
41 Network network(String networkId);
42
43 /**
44 * Returns all networks registered in the service.
45 *
46 * @return set of networks
47 */
48 Set<Network> networks();
49
50 /**
51 * Returns the subnet with the supplied subnet ID.
52 *
53 * @param subnetId subnet id
54 * @return subnet
55 */
56 Subnet subnet(String subnetId);
57
58 /**
59 * Returns all subnets registered in the service.
60 *
61 * @return set of subnet
62 */
63 Set<Subnet> subnets();
64
65 /**
66 * Returns all subnets associated with the supplied network.
67 *
68 * @param networkId network id
69 * @return set of subnet
70 */
71 Set<Subnet> subnets(String networkId);
72
73 /**
74 * Returns the OpenStack port with the supplied port ID.
75 *
76 * @param portId openstack port id
77 * @return openstack port
78 */
79 Port port(String portId);
80
81 /**
82 * Returns the OpenStack port with the supplied ONOS port.
83 *
84 * @param port onos port
85 * @return openstack port
86 */
87 Port port(org.onosproject.net.Port port);
88
89 /**
90 * Returns all OpenStack ports registered in the service.
91 *
92 * @return set of ports
93 */
94 Set<Port> ports();
95
96 /**
daniel parkb5817102018-02-15 00:18:51 +090097 * Returns all OpenStack ports associated with supplied network.
98 *
Hyunsun Moon44aac662017-02-18 02:07:01 +090099 * @param networkId network id
100 * @return set of ports
101 */
102 Set<Port> ports(String networkId);
daniel parkb5817102018-02-15 00:18:51 +0900103
104 /**
105 * Derives external router mac address with supplied external gateway.
106 *
107 * @param externalGateway external gateway information
108 * @param router router which owns externalGateway
daniel park576969a2018-03-09 07:07:41 +0900109 * @param vlanId vlan id of external network
daniel parkb5817102018-02-15 00:18:51 +0900110 */
daniel park576969a2018-03-09 07:07:41 +0900111 void deriveExternalPeerRouterMac(ExternalGateway externalGateway, Router router, VlanId vlanId);
daniel parkb5817102018-02-15 00:18:51 +0900112
113 /**
114 * Deletes external router with supplied external gateway.
115 *
116 * @param externalGateway external gateway information
117 */
118 void deleteExternalPeerRouter(ExternalGateway externalGateway);
119
120 /**
daniel parkeeb8e042018-02-21 14:06:58 +0900121 * Deletes external router with supplied ip address.
122 *
123 * @param ipAddress ip address
124 */
125 void deleteExternalPeerRouter(String ipAddress);
126
127 /**
daniel parkb5817102018-02-15 00:18:51 +0900128 * Updates external router mac address with supplied ip address.
129 *
130 * @param ipAddress ip address
131 * @param macAddress mac address
132 */
133 void updateExternalPeerRouterMac(IpAddress ipAddress, MacAddress macAddress);
134
135 /**
136 * Updates external router vlan id with supplied ip address.
137 *
138 * @param ipAddress ip address
139 * @param vlanId vlan id
140 */
141 void updateExternalPeerRouterVlan(IpAddress ipAddress, VlanId vlanId);
142
143 /**
144 * Updates external router ith supplied ip address, mac address, vlan id.
145 *
146 * @param ipAddress ip address
147 * @param macAddress mac address
148 * @param vlanId vlan id
149 */
150 void updateExternalPeerRouter(IpAddress ipAddress, MacAddress macAddress, VlanId vlanId);
151
152 /**
153 * Returns external router mac with supplied external gateway.
154 *
155 * @param externalGateway external gateway information
156 * @return mac address
157 */
158 MacAddress externalPeerRouterMac(ExternalGateway externalGateway);
159
160 /**
161 * Returns external peer router with supplied ip address.
162 *
163 * @param ipAddress ip address
164 * @return external peer router
165 */
166 ExternalPeerRouter externalPeerRouter(IpAddress ipAddress);
167
168 /**
daniel park576969a2018-03-09 07:07:41 +0900169 * Returns external router with supplied external gateway.
170 *
171 * @param externalGateway external gateway information
172 * @return external router
173 */
174 ExternalPeerRouter externalPeerRouter(ExternalGateway externalGateway);
175
176 /**
daniel parkb5817102018-02-15 00:18:51 +0900177 * Returns external peer router list.
178 *
179 * @return external peer router list
180 */
181 Set<ExternalPeerRouter> externalPeerRouters();
182
Hyunsun Moon44aac662017-02-18 02:07:01 +0900183}