blob: 63f8ef2ad228b1b6686f1c5024b8894e2d74e024 [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 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +090033 * List of valid node types.
34 */
35 enum NodeType {
36 COMPUTE,
Jian Li27841662018-04-14 01:59:47 +090037 GATEWAY,
38 CONTROLLER
Hyunsun Moon0d457362017-06-27 17:19:41 +090039 }
40
41 /**
42 * Returns hostname of the node.
43 *
44 * @return hostname
45 */
46 String hostname();
47
48 /**
49 * Returns the type of the node.
50 *
51 * @return node type
52 */
53 NodeType type();
54
55 /**
56 * Returns the OVSDB device ID of the node.
57 *
58 * @return ovsdb device id
59 */
60 DeviceId ovsdb();
61
62 /**
63 * Returns the device ID of the integration bridge at the node.
64 *
65 * @return device id
66 */
67 DeviceId intgBridge();
68
69 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +090070 * Returns the management network IP address of the node.
71 *
72 * @return ip address
73 */
74 IpAddress managementIp();
75
76 /**
77 * Returns the data network IP address used for tunneling.
78 *
79 * @return ip address; null if vxlan mode is not enabled
80 */
81 IpAddress dataIp();
82
83 /**
84 * Returns the name of the vlan interface.
85 *
86 * @return vlan interface name; null if vlan mode is not enabled
87 */
88 String vlanIntf();
89
90 /**
91 * Returns the initialization state of the node.
92 *
93 * @return node state
94 */
95 NodeState state();
96
97 /**
Jian Li2d68c192018-12-13 15:52:59 +090098 * Returns the GRE tunnel port number.
Hyunsun Moon0d457362017-06-27 17:19:41 +090099 *
Jian Li2d68c192018-12-13 15:52:59 +0900100 * @return GRE port number; null if the GRE tunnel port does not exist
Hyunsun Moon0d457362017-06-27 17:19:41 +0900101 */
Jian Li2d68c192018-12-13 15:52:59 +0900102 PortNumber greTunnelPortNum();
103
104 /**
105 * Returns the VXLAN tunnel port number.
106 *
107 * @return VXLAN port number; null if tunnel port does not exist
108 */
109 PortNumber vxlanTunnelPortNum();
Hyunsun Moon0d457362017-06-27 17:19:41 +0900110
111 /**
Jian Li340165f2018-02-27 10:38:17 +0900112 * Returns the vlan port number.
Hyunsun Moon0d457362017-06-27 17:19:41 +0900113 *
114 * @return port number; null if vlan port does not exist
115 */
116 PortNumber vlanPortNum();
117
118 /**
119 * Returns the patch port number of the integration bridge.
120 *
121 * @return port number; null if the node type is compute
122 */
123 PortNumber patchPortNum();
124
125 /**
126 * Returns the vlan port MAC address.
127 *
128 * @return mac address; null if vlan port does not exist
129 */
130 MacAddress vlanPortMac();
131
132 /**
daniel parkb18424c2018-02-05 15:43:43 +0900133 * Returns the uplink port name.
134 *
135 * @return uplink port name; null if the node type is compute
136 */
137 String uplinkPort();
138
139 /**
Daniel Park92abf312018-08-08 17:01:35 +0900140 * Returns the data path type.
141 *
142 * @return data path type; normal or netdev
143 */
144 DatapathType datapathType();
145
146 /**
Daniel Park7e8c4d82018-08-13 23:47:49 +0900147 * Returns socket directory which dpdk port bound to.
148 *
149 * @return socket directory
150 */
151 String socketDir();
152
153 /**
daniel parkb5817102018-02-15 00:18:51 +0900154 * Returns the uplink port number.
155 *
156 * @return uplink port number
157 */
158 PortNumber uplinkPortNum();
159
160 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900161 * Returns new openstack node instance with given state.
162 *
163 * @param newState updated state
164 * @return updated openstack node
165 */
166 OpenstackNode updateState(NodeState newState);
167
168 /**
Jian Lie3141542018-08-13 18:05:43 +0900169 * Returns new openstack node instance with given integration bridge.
170 *
171 * @param newIntgBridge updated integration bridge
172 * @return updated openstack node
173 */
174 OpenstackNode updateIntbridge(DeviceId newIntgBridge);
175
176 /**
Jian Lie6312162018-03-21 21:41:00 +0900177 * Returns a collection of physical interfaces.
178 *
179 * @return physical interfaces
180 */
181 Collection<OpenstackPhyInterface> phyIntfs();
182
183 /**
daniel park796c2eb2018-03-22 17:01:51 +0900184 * Returns the port number of given physical interface.
185 *
186 * @param providerPhysnet provider physical network name
187 * @return port number
188 */
189 PortNumber phyIntfPortNum(String providerPhysnet);
190
191 /**
Jian Li789fadb2018-07-10 13:59:47 +0900192 * Returns a collection of customized controllers.
193 *
194 * @return customized controllers
195 */
196 Collection<ControllerInfo> controllers();
197
198 /**
Daniel Parkdeefa702018-07-17 17:55:51 +0900199 * Returns the ssh authentication info.
200 *
201 * @return ssh authentication info
202 */
203 OpenstackSshAuth sshAuthInfo();
204
205 /**
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900206 * Returns the dpdk config info.
207 *
208 * @return dpdk config
209 */
210 DpdkConfig dpdkConfig();
211
212 /**
Jian Lic704b672018-09-04 18:52:53 +0900213 * Returns the keystone config info.
214 *
215 * @return keystone config
216 */
217 KeystoneConfig keystoneConfig();
218
219 /**
220 * Returns the neutron config info.
221 *
222 * @return neutron config
223 */
224 NeutronConfig neutronConfig();
225
226 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900227 * Builder of new node entities.
228 */
229 interface Builder {
230
231 /**
232 * Builds an immutable openstack node instance.
233 *
234 * @return openstack node instance
235 */
236 OpenstackNode build();
237
238 /**
239 * Returns openstack node builder with supplied hostname.
240 *
241 * @param hostname hostname of the node
242 * @return opesntack node builder
243 */
244 Builder hostname(String hostname);
245
246 /**
247 * Returns openstack node builder with supplied type.
248 *
249 * @param type openstack node type
250 * @return openstack node builder
251 */
252 Builder type(NodeType type);
253
254 /**
255 * Returns openstack node builder with supplied integration bridge ID.
256 *
257 * @param intgBridge integration bridge device id
258 * @return openstack node builder
259 */
260 Builder intgBridge(DeviceId intgBridge);
261
262 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900263 * Returns openstack node builder with supplied management IP address.
264 *
265 * @param managementIp management ip address
266 * @return openstack node builder
267 */
268 Builder managementIp(IpAddress managementIp);
269
270 /**
271 * Returns openstack node builder with supplied data network IP address.
272 *
273 * @param dataIp data network ip address
274 * @return openstack node builder
275 */
276 Builder dataIp(IpAddress dataIp);
277
278 /**
279 * Returns openstack node builder with supplied vlan interface.
280 *
281 * @param vlanIntf vlan interface name
282 * @return openstack node builder
283 */
284 Builder vlanIntf(String vlanIntf);
285
286 /**
daniel parkb18424c2018-02-05 15:43:43 +0900287 * Returns openstack node builder with supplied uplink port.
288 *
289 * @param uplinkPort uplink port name
290 * @return openstack node builder
291 */
292 Builder uplinkPort(String uplinkPort);
293
294 /**
Hyunsun Moon0d457362017-06-27 17:19:41 +0900295 * Returns openstack node builder with supplied node state.
296 *
297 * @param state node state
298 * @return openstack node builder
299 */
300 Builder state(NodeState state);
Jian Lie6312162018-03-21 21:41:00 +0900301
302 /**
303 * Returns openstack node builder with supplied physical interfaces.
304 *
305 * @param phyIntfs a collection of physical interfaces
306 * @return openstack node builder
307 */
308 Builder phyIntfs(Collection<OpenstackPhyInterface> phyIntfs);
Jian Li27841662018-04-14 01:59:47 +0900309
310 /**
Jian Li789fadb2018-07-10 13:59:47 +0900311 * Returns openstack node builder with supplied customized controllers.
312 *
313 * @param controllers a collection of customized controllers
314 * @return openstack node builder
315 */
316 Builder controllers(Collection<ControllerInfo> controllers);
317
318 /**
Daniel Parkdeefa702018-07-17 17:55:51 +0900319 * Returns openstack node builder with supplied ssh authentication info.
320 *
321 * @param sshAuth ssh authentication info
322 * @return openstack node builder
323 */
324 Builder sshAuthInfo(OpenstackSshAuth sshAuth);
Daniel Park92abf312018-08-08 17:01:35 +0900325
326 /**
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900327 * Returns openstack node builder with supplied dpdk config info.
Daniel Park92abf312018-08-08 17:01:35 +0900328 *
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900329 * @param dpdkConfig dpdk config
Daniel Park92abf312018-08-08 17:01:35 +0900330 * @return openstack node builder
331 */
Daniel Parkd02d7bd2018-08-23 23:04:31 +0900332 Builder dpdkConfig(DpdkConfig dpdkConfig);
Jian Lic704b672018-09-04 18:52:53 +0900333
334 /**
335 * Returns openstack node builder with supplied keystone config info.
336 *
337 * @param keystoneConfig keystone config
338 * @return openstack node builder
339 */
340 Builder keystoneConfig(KeystoneConfig keystoneConfig);
341
342 /**
343 * Returns openstack node builder with supplied neutron config info.
344 *
345 * @param neutronConfig neutron config
346 * @return openstack node builder
347 */
348 Builder neutronConfig(NeutronConfig neutronConfig);
Hyunsun Moon0d457362017-06-27 17:19:41 +0900349 }
350}
351