Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 8e57fd5 | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 3 | * |
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 | */ | ||||
Hyunsun Moon | fd5a24e | 2016-10-19 19:15:48 -0700 | [diff] [blame] | 16 | package org.opencord.cordvtn.api.node; |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 17 | |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 18 | import org.onlab.packet.TpPort; |
19 | import org.onosproject.net.DeviceId; | ||||
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 20 | import org.opencord.cordvtn.api.net.CidrAddr; |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 21 | |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 22 | import java.util.Set; |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 23 | |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 24 | /** |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 25 | * Representation of a compute node for service instance provisioning. |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 26 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 27 | public interface CordVtnNode { |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 28 | |
29 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 30 | * Returns the hostname of the node. |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 31 | * |
32 | * @return hostname | ||||
33 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 34 | String hostname(); |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 35 | |
36 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 37 | * Returns the host management IP address of the node. |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 38 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 39 | * @return ip address with cidr notation |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 40 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 41 | CidrAddr hostManagementIp(); |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 42 | |
43 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 44 | * Returns the local management IP address of the node. |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 45 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 46 | * @return ip address with the cidr notation |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 47 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 48 | // TODO remove this after dynamic provisioning of local management network |
49 | CidrAddr localManagementIp(); | ||||
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 50 | |
51 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 52 | * Returns the data network IP address of the node. |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 53 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 54 | * @return ip address with the cidr notation |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 55 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 56 | CidrAddr dataIp(); |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 57 | |
58 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 59 | * Returns the integration bridge device identifier. |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 60 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 61 | * @return device id |
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 62 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 63 | DeviceId integrationBridgeId(); |
64 | |||||
65 | /** | ||||
66 | * Returns the data network interface name. | ||||
67 | * | ||||
68 | * @return interface name | ||||
69 | */ | ||||
70 | String dataInterface(); | ||||
71 | |||||
72 | /** | ||||
73 | * Returns host management network interface name. | ||||
74 | * | ||||
75 | * @return interface name; null if not set | ||||
76 | */ | ||||
77 | String hostManagementInterface(); | ||||
78 | |||||
79 | /** | ||||
80 | * Returns the port number of the OVSDB server. | ||||
81 | * | ||||
82 | * @return port number; 6640 if not set | ||||
83 | */ | ||||
84 | TpPort ovsdbPort(); | ||||
Hyunsun Moon | 126171d | 2016-02-09 01:55:48 -0800 | [diff] [blame] | 85 | |
86 | /** | ||||
87 | * Returns the SSH access information. | ||||
88 | * | ||||
89 | * @return ssh access information | ||||
90 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 91 | SshAccessInfo sshInfo(); |
Hyunsun Moon | de37257 | 2016-01-14 03:42:47 -0800 | [diff] [blame] | 92 | |
Hyunsun Moon | 58ddbdc | 2016-03-07 16:37:17 -0800 | [diff] [blame] | 93 | /** |
94 | * Returns the state of the node. | ||||
95 | * | ||||
96 | * @return state | ||||
97 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 98 | CordVtnNodeState state(); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 99 | |
100 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 101 | * Returns the identifier of the OVSDB device. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 102 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 103 | * @return device id |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 104 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 105 | DeviceId ovsdbId(); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 106 | |
107 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 108 | * Returns system interfaces of the node. |
109 | * | ||||
110 | * @return set of interface names | ||||
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 111 | */ |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 112 | Set<String> systemInterfaces(); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 113 | |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 114 | /** |
115 | * Builder of cordvtn node entities. | ||||
116 | */ | ||||
117 | interface Builder { | ||||
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 118 | |
119 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 120 | * Returns new cordvtn node. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 121 | * |
122 | * @return cordvtn node | ||||
123 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 124 | CordVtnNode build(); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 125 | |
126 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 127 | * Returns cordvtn node builder with the supplied hostname. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 128 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 129 | * @param hostname hostname of the node |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 130 | * @return cordvtn node builder |
131 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 132 | Builder hostname(String hostname); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 133 | |
134 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 135 | * Returns cordvtn node builder with the supplied host management IP. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 136 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 137 | * @param hostMgmtIp ip address with cidr notation |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 138 | * @return cordvtn node builder |
139 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 140 | Builder hostManagementIp(CidrAddr hostMgmtIp); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 141 | |
142 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 143 | * Returns cordvtn node builder with the supplied local management IP. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 144 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 145 | * @param localMgmtIp ip address with cidr notation |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 146 | * @return cordvtn node builder |
147 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 148 | // TODO remove this after dynamic provisioning of local management network |
149 | Builder localManagementIp(CidrAddr localMgmtIp); | ||||
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 150 | |
151 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 152 | * Returns cordvtn node builder with the supplied data IP. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 153 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 154 | * @param dataIp ip address with cidr notation |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 155 | * @return cordvtn node builder |
156 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 157 | Builder dataIp(CidrAddr dataIp); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 158 | |
159 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 160 | * Returns cordvtn node builder with the supplied integration bridge identifier. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 161 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 162 | * @param bridgeId bridge identifier |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 163 | * @return cordvtn node builder |
164 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 165 | Builder integrationBridgeId(DeviceId bridgeId); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 166 | |
167 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 168 | * Returns cordvtn node builder with the supplied data interface. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 169 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 170 | * @param dataIface interface name |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 171 | * @return cordvtn node builder |
172 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 173 | Builder dataInterface(String dataIface); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 174 | |
175 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 176 | * Returns cordvtn node builder with the supplied host management interface. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 177 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 178 | * @param hostMgmtIface interface name |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 179 | * @return cordvtn node builder |
180 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 181 | Builder hostManagementInterface(String hostMgmtIface); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 182 | |
183 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 184 | * Returns cordvtn node builder with the supplied OVSDB port. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 185 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 186 | * @param ovsdbPort transport layer port number |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 187 | * @return cordvtn node builder |
188 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 189 | Builder ovsdbPort(TpPort ovsdbPort); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 190 | |
191 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 192 | * Returns cordvtn node builder with the supplied SSH access information. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 193 | * |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 194 | * @param sshInfo ssh access information |
195 | * @return cordvtn node builder | ||||
196 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 197 | Builder sshInfo(SshAccessInfo sshInfo); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 198 | |
199 | /** | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 200 | * Returns cordvtn node builder with the supplied initialize state. |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 201 | * |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 202 | * @param state cordvtn node state |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 203 | * @return cordvtn node builder |
204 | */ | ||||
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 205 | Builder state(CordVtnNodeState state); |
Hyunsun Moon | 81a1356 | 2016-08-04 13:48:08 -0700 | [diff] [blame] | 206 | } |
Hyunsun Moon | 4edb017 | 2015-11-07 22:08:43 -0800 | [diff] [blame] | 207 | } |