blob: a2000eec2611829e4ab744c0bfb1f21975aa7fd5 [file] [log] [blame]
Hyunsun Moon0d457362017-06-27 17:19:41 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon0d457362017-06-27 17:19:41 +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.openstacknode.api;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
Hyunsun Moon0d457362017-06-27 17:19:41 +090020import org.onosproject.net.DeviceId;
21import org.onosproject.net.PortNumber;
Jian Li789fadb2018-07-10 13:59:47 +090022import org.onosproject.net.behaviour.ControllerInfo;
Daniel Parkd02d7bd2018-08-23 23:04:31 +090023import org.onosproject.openstacknode.api.DpdkConfig.DatapathType;
Hyunsun Moon0d457362017-06-27 17:19:41 +090024
Jian Lie6312162018-03-21 21:41:00 +090025import java.util.Collection;
26
Hyunsun Moon0d457362017-06-27 17:19:41 +090027/**
28 * Representation of a node used in OpenstackNetworking service.
29 */
30public interface OpenstackNode {
31
32 /**
Jian Lie6312162018-03-21 21:41:00 +090033 * List of valid network modes.
34 * This includes both physical and virtual network types.
Hyunsun Moon0d457362017-06-27 17:19:41 +090035 */
36 enum NetworkMode {
37 VXLAN,
Jian Lie6312162018-03-21 21:41:00 +090038 VLAN,
39 FLAT
Hyunsun Moon0d457362017-06-27 17:19:41 +090040 }
41
42 /**
43 * List of valid node types.
44 */
45 enum NodeType {
46 COMPUTE,
Jian Li27841662018-04-14 01:59:47 +090047 GATEWAY,
48 CONTROLLER
Hyunsun Moon0d457362017-06-27 17:19:41 +090049 }
50
51 /**
52 * Returns hostname of the node.
53 *
54 * @return hostname
55 */
56 String hostname();
57
58 /**
59 * Returns the type of the node.
60 *
61 * @return node type
62 */
63 NodeType type();
64
65 /**
66 * Returns the OVSDB device ID of the node.
67 *
68 * @return ovsdb device id
69 */
70 DeviceId ovsdb();
71
72 /**
73 * Returns the device ID of the integration bridge at the node.
74 *
75 * @return device id
76 */
77 DeviceId intgBridge();
78
79 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +090080 * Returns the management network IP address of the node.
81 *
82 * @return ip address
83 */
84 IpAddress managementIp();
85
86 /**
87 * Returns the data network IP address used for tunneling.
88 *
89 * @return ip address; null if vxlan mode is not enabled
90 */
91 IpAddress dataIp();
92
93 /**
94 * Returns the name of the vlan interface.
95 *
96 * @return vlan interface name; null if vlan mode is not enabled
97 */
98 String vlanIntf();
99
100 /**
101 * Returns the initialization state of the node.
102 *
103 * @return node state
104 */
105 NodeState state();
106
107 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900108 * Returns the tunnel port number.
109 *
110 * @return port number; null if tunnel port does not exist
111 */
112 PortNumber tunnelPortNum();
113
114 /**
Jian Li340165f2018-02-27 10:38:17 +0900115 * Returns the vlan port number.
Hyunsun Moon0d457362017-06-27 17:19:41 +0900116 *
117 * @return port number; null if vlan port does not exist
118 */
119 PortNumber vlanPortNum();
120
121 /**
122 * Returns the patch port number of the integration bridge.
123 *
124 * @return port number; null if the node type is compute
125 */
126 PortNumber patchPortNum();
127
128 /**
129 * Returns the vlan port MAC address.
130 *
131 * @return mac address; null if vlan port does not exist
132 */
133 MacAddress vlanPortMac();
134
135 /**
daniel parkb18424c2018-02-05 15:43:43 +0900136 * Returns the uplink port name.
137 *
138 * @return uplink port name; null if the node type is compute
139 */
140 String uplinkPort();
141
142 /**
Daniel Park92abf312018-08-08 17:01:35 +0900143 * Returns the data path type.
144 *
145 * @return data path type; normal or netdev
146 */
147 DatapathType datapathType();
148
149 /**
Daniel Park7e8c4d82018-08-13 23:47:49 +0900150 * Returns socket directory which dpdk port bound to.
151 *
152 * @return socket directory
153 */
154 String socketDir();
155
156 /**
daniel parkb5817102018-02-15 00:18:51 +0900157 * Returns the uplink port number.
158 *
159 * @return uplink port number
160 */
161 PortNumber uplinkPortNum();
162
163 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900164 * Returns new openstack node instance with given state.
165 *
166 * @param newState updated state
167 * @return updated openstack node
168 */
169 OpenstackNode updateState(NodeState newState);
170
171 /**
Jian Lie3141542018-08-13 18:05:43 +0900172 * Returns new openstack node instance with given integration bridge.
173 *
174 * @param newIntgBridge updated integration bridge
175 * @return updated openstack node
176 */
177 OpenstackNode updateIntbridge(DeviceId newIntgBridge);
178
179 /**
Jian Lie6312162018-03-21 21:41:00 +0900180 * Returns a collection of physical interfaces.
181 *
182 * @return physical interfaces
183 */
184 Collection<OpenstackPhyInterface> phyIntfs();
185
186 /**
daniel park796c2eb2018-03-22 17:01:51 +0900187 * Returns the port number of given physical interface.
188 *
189 * @param providerPhysnet provider physical network name
190 * @return port number
191 */
192 PortNumber phyIntfPortNum(String providerPhysnet);
193
194 /**
Jian Li789fadb2018-07-10 13:59:47 +0900195 * Returns a collection of customized controllers.
196 *
197 * @return customized controllers
198 */
199 Collection<ControllerInfo> controllers();
200
201 /**
Daniel Parkdeefa702018-07-17 17:55:51 +0900202 * Returns the ssh authentication info.
203 *
204 * @return ssh authentication info
205 */
206 OpenstackSshAuth sshAuthInfo();
207
208 /**
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900209 * Returns the dpdk config info.
210 *
211 * @return dpdk config
212 */
213 DpdkConfig dpdkConfig();
214
215 /**
Jian Lic704b672018-09-04 18:52:53 +0900216 * Returns the keystone config info.
217 *
218 * @return keystone config
219 */
220 KeystoneConfig keystoneConfig();
221
222 /**
223 * Returns the neutron config info.
224 *
225 * @return neutron config
226 */
227 NeutronConfig neutronConfig();
228
229 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900230 * Builder of new node entities.
231 */
232 interface Builder {
233
234 /**
235 * Builds an immutable openstack node instance.
236 *
237 * @return openstack node instance
238 */
239 OpenstackNode build();
240
241 /**
242 * Returns openstack node builder with supplied hostname.
243 *
244 * @param hostname hostname of the node
245 * @return opesntack node builder
246 */
247 Builder hostname(String hostname);
248
249 /**
250 * Returns openstack node builder with supplied type.
251 *
252 * @param type openstack node type
253 * @return openstack node builder
254 */
255 Builder type(NodeType type);
256
257 /**
258 * Returns openstack node builder with supplied integration bridge ID.
259 *
260 * @param intgBridge integration bridge device id
261 * @return openstack node builder
262 */
263 Builder intgBridge(DeviceId intgBridge);
264
265 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900266 * Returns openstack node builder with supplied management IP address.
267 *
268 * @param managementIp management ip address
269 * @return openstack node builder
270 */
271 Builder managementIp(IpAddress managementIp);
272
273 /**
274 * Returns openstack node builder with supplied data network IP address.
275 *
276 * @param dataIp data network ip address
277 * @return openstack node builder
278 */
279 Builder dataIp(IpAddress dataIp);
280
281 /**
282 * Returns openstack node builder with supplied vlan interface.
283 *
284 * @param vlanIntf vlan interface name
285 * @return openstack node builder
286 */
287 Builder vlanIntf(String vlanIntf);
288
289 /**
daniel parkb18424c2018-02-05 15:43:43 +0900290 * Returns openstack node builder with supplied uplink port.
291 *
292 * @param uplinkPort uplink port name
293 * @return openstack node builder
294 */
295 Builder uplinkPort(String uplinkPort);
296
297 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900298 * Returns openstack node builder with supplied node state.
299 *
300 * @param state node state
301 * @return openstack node builder
302 */
303 Builder state(NodeState state);
Jian Lie6312162018-03-21 21:41:00 +0900304
305 /**
306 * Returns openstack node builder with supplied physical interfaces.
307 *
308 * @param phyIntfs a collection of physical interfaces
309 * @return openstack node builder
310 */
311 Builder phyIntfs(Collection<OpenstackPhyInterface> phyIntfs);
Jian Li27841662018-04-14 01:59:47 +0900312
313 /**
Jian Li789fadb2018-07-10 13:59:47 +0900314 * Returns openstack node builder with supplied customized controllers.
315 *
316 * @param controllers a collection of customized controllers
317 * @return openstack node builder
318 */
319 Builder controllers(Collection<ControllerInfo> controllers);
320
321 /**
Daniel Parkdeefa702018-07-17 17:55:51 +0900322 * Returns openstack node builder with supplied ssh authentication info.
323 *
324 * @param sshAuth ssh authentication info
325 * @return openstack node builder
326 */
327 Builder sshAuthInfo(OpenstackSshAuth sshAuth);
Daniel Park92abf312018-08-08 17:01:35 +0900328
329 /**
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900330 * Returns openstack node builder with supplied dpdk config info.
Daniel Park92abf312018-08-08 17:01:35 +0900331 *
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900332 * @param dpdkConfig dpdk config
Daniel Park92abf312018-08-08 17:01:35 +0900333 * @return openstack node builder
334 */
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900335 Builder dpdkConfig(DpdkConfig dpdkConfig);
Jian Lic704b672018-09-04 18:52:53 +0900336
337 /**
338 * Returns openstack node builder with supplied keystone config info.
339 *
340 * @param keystoneConfig keystone config
341 * @return openstack node builder
342 */
343 Builder keystoneConfig(KeystoneConfig keystoneConfig);
344
345 /**
346 * Returns openstack node builder with supplied neutron config info.
347 *
348 * @param neutronConfig neutron config
349 * @return openstack node builder
350 */
351 Builder neutronConfig(NeutronConfig neutronConfig);
Hyunsun Moon0d457362017-06-27 17:19:41 +0900352 }
353}
354