blob: a297b830b99bf4f996fb9d80a7830aa8c9f7ff57 [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
109 */
110 void deriveExternalPeerRouterMac(ExternalGateway externalGateway, Router router);
111
112 /**
113 * Deletes external router with supplied external gateway.
114 *
115 * @param externalGateway external gateway information
116 */
117 void deleteExternalPeerRouter(ExternalGateway externalGateway);
118
119 /**
120 * Updates external router mac address with supplied ip address.
121 *
122 * @param ipAddress ip address
123 * @param macAddress mac address
124 */
125 void updateExternalPeerRouterMac(IpAddress ipAddress, MacAddress macAddress);
126
127 /**
128 * Updates external router vlan id with supplied ip address.
129 *
130 * @param ipAddress ip address
131 * @param vlanId vlan id
132 */
133 void updateExternalPeerRouterVlan(IpAddress ipAddress, VlanId vlanId);
134
135 /**
136 * Updates external router ith supplied ip address, mac address, vlan id.
137 *
138 * @param ipAddress ip address
139 * @param macAddress mac address
140 * @param vlanId vlan id
141 */
142 void updateExternalPeerRouter(IpAddress ipAddress, MacAddress macAddress, VlanId vlanId);
143
144 /**
145 * Returns external router mac with supplied external gateway.
146 *
147 * @param externalGateway external gateway information
148 * @return mac address
149 */
150 MacAddress externalPeerRouterMac(ExternalGateway externalGateway);
151
152 /**
153 * Returns external peer router with supplied ip address.
154 *
155 * @param ipAddress ip address
156 * @return external peer router
157 */
158 ExternalPeerRouter externalPeerRouter(IpAddress ipAddress);
159
160 /**
161 * Returns external peer router list.
162 *
163 * @return external peer router list
164 */
165 Set<ExternalPeerRouter> externalPeerRouters();
166
Hyunsun Moon44aac662017-02-18 02:07:01 +0900167}