blob: 1e873a468c2aab848885aef5a2cee2963ab9b3c1 [file] [log] [blame]
Hyunsun Moon4edb0172015-11-07 22:08:43 -08001/*
Brian O'Connor8e57fd52016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Hyunsun Moon4edb0172015-11-07 22:08:43 -08003 *
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 Moonfd5a24e2016-10-19 19:15:48 -070016package org.opencord.cordvtn.api.node;
Hyunsun Moon4edb0172015-11-07 22:08:43 -080017
Hyunsun Moon4edb0172015-11-07 22:08:43 -080018import org.onlab.packet.TpPort;
19import org.onosproject.net.DeviceId;
Hyunsun Moon187bf532017-01-19 10:57:40 +090020import org.opencord.cordvtn.api.net.CidrAddr;
Hyunsun Moon4edb0172015-11-07 22:08:43 -080021
Hyunsun Moon81a13562016-08-04 13:48:08 -070022import java.util.Set;
Hyunsun Moon4edb0172015-11-07 22:08:43 -080023
Hyunsun Moon4edb0172015-11-07 22:08:43 -080024/**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090025 * Representation of a compute node for service instance provisioning.
Hyunsun Moon4edb0172015-11-07 22:08:43 -080026 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090027public interface CordVtnNode {
Hyunsun Moon4edb0172015-11-07 22:08:43 -080028
29 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090030 * Returns the hostname of the node.
Hyunsun Moon4edb0172015-11-07 22:08:43 -080031 *
32 * @return hostname
33 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090034 String hostname();
Hyunsun Moon4edb0172015-11-07 22:08:43 -080035
36 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090037 * Returns the host management IP address of the node.
Hyunsun Moon126171d2016-02-09 01:55:48 -080038 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090039 * @return ip address with cidr notation
Hyunsun Moon126171d2016-02-09 01:55:48 -080040 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090041 CidrAddr hostManagementIp();
Hyunsun Moon126171d2016-02-09 01:55:48 -080042
43 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090044 * Returns the local management IP address of the node.
Hyunsun Moon126171d2016-02-09 01:55:48 -080045 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090046 * @return ip address with the cidr notation
Hyunsun Moon126171d2016-02-09 01:55:48 -080047 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090048 // TODO remove this after dynamic provisioning of local management network
49 CidrAddr localManagementIp();
Hyunsun Moon126171d2016-02-09 01:55:48 -080050
51 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090052 * Returns the data network IP address of the node.
Hyunsun Moon126171d2016-02-09 01:55:48 -080053 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090054 * @return ip address with the cidr notation
Hyunsun Moon126171d2016-02-09 01:55:48 -080055 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090056 CidrAddr dataIp();
Hyunsun Moon126171d2016-02-09 01:55:48 -080057
58 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090059 * Returns the integration bridge device identifier.
Hyunsun Moon126171d2016-02-09 01:55:48 -080060 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090061 * @return device id
Hyunsun Moon126171d2016-02-09 01:55:48 -080062 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090063 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 Moon126171d2016-02-09 01:55:48 -080085
86 /**
87 * Returns the SSH access information.
88 *
89 * @return ssh access information
90 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090091 SshAccessInfo sshInfo();
Hyunsun Moonde372572016-01-14 03:42:47 -080092
Hyunsun Moon58ddbdc2016-03-07 16:37:17 -080093 /**
94 * Returns the state of the node.
95 *
96 * @return state
97 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +090098 CordVtnNodeState state();
Hyunsun Moon81a13562016-08-04 13:48:08 -070099
100 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900101 * Returns the identifier of the OVSDB device.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700102 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900103 * @return device id
Hyunsun Moon81a13562016-08-04 13:48:08 -0700104 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900105 DeviceId ovsdbId();
Hyunsun Moon81a13562016-08-04 13:48:08 -0700106
107 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900108 * Returns system interfaces of the node.
109 *
110 * @return set of interface names
Hyunsun Moon81a13562016-08-04 13:48:08 -0700111 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900112 Set<String> systemInterfaces();
Hyunsun Moon81a13562016-08-04 13:48:08 -0700113
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900114 /**
115 * Builder of cordvtn node entities.
116 */
117 interface Builder {
Hyunsun Moon81a13562016-08-04 13:48:08 -0700118
119 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900120 * Returns new cordvtn node.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700121 *
122 * @return cordvtn node
123 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900124 CordVtnNode build();
Hyunsun Moon81a13562016-08-04 13:48:08 -0700125
126 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900127 * Returns cordvtn node builder with the supplied hostname.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700128 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900129 * @param hostname hostname of the node
Hyunsun Moon81a13562016-08-04 13:48:08 -0700130 * @return cordvtn node builder
131 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900132 Builder hostname(String hostname);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700133
134 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900135 * Returns cordvtn node builder with the supplied host management IP.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700136 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900137 * @param hostMgmtIp ip address with cidr notation
Hyunsun Moon81a13562016-08-04 13:48:08 -0700138 * @return cordvtn node builder
139 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900140 Builder hostManagementIp(CidrAddr hostMgmtIp);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700141
142 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900143 * Returns cordvtn node builder with the supplied local management IP.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700144 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900145 * @param localMgmtIp ip address with cidr notation
Hyunsun Moon81a13562016-08-04 13:48:08 -0700146 * @return cordvtn node builder
147 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900148 // TODO remove this after dynamic provisioning of local management network
149 Builder localManagementIp(CidrAddr localMgmtIp);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700150
151 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900152 * Returns cordvtn node builder with the supplied data IP.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700153 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900154 * @param dataIp ip address with cidr notation
Hyunsun Moon81a13562016-08-04 13:48:08 -0700155 * @return cordvtn node builder
156 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900157 Builder dataIp(CidrAddr dataIp);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700158
159 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900160 * Returns cordvtn node builder with the supplied integration bridge identifier.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700161 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900162 * @param bridgeId bridge identifier
Hyunsun Moon81a13562016-08-04 13:48:08 -0700163 * @return cordvtn node builder
164 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900165 Builder integrationBridgeId(DeviceId bridgeId);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700166
167 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900168 * Returns cordvtn node builder with the supplied data interface.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700169 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900170 * @param dataIface interface name
Hyunsun Moon81a13562016-08-04 13:48:08 -0700171 * @return cordvtn node builder
172 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900173 Builder dataInterface(String dataIface);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700174
175 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900176 * Returns cordvtn node builder with the supplied host management interface.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700177 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900178 * @param hostMgmtIface interface name
Hyunsun Moon81a13562016-08-04 13:48:08 -0700179 * @return cordvtn node builder
180 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900181 Builder hostManagementInterface(String hostMgmtIface);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700182
183 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900184 * Returns cordvtn node builder with the supplied OVSDB port.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700185 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900186 * @param ovsdbPort transport layer port number
Hyunsun Moon81a13562016-08-04 13:48:08 -0700187 * @return cordvtn node builder
188 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900189 Builder ovsdbPort(TpPort ovsdbPort);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700190
191 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900192 * Returns cordvtn node builder with the supplied SSH access information.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700193 *
Hyunsun Moon81a13562016-08-04 13:48:08 -0700194 * @param sshInfo ssh access information
195 * @return cordvtn node builder
196 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900197 Builder sshInfo(SshAccessInfo sshInfo);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700198
199 /**
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900200 * Returns cordvtn node builder with the supplied initialize state.
Hyunsun Moon81a13562016-08-04 13:48:08 -0700201 *
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900202 * @param state cordvtn node state
Hyunsun Moon81a13562016-08-04 13:48:08 -0700203 * @return cordvtn node builder
204 */
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +0900205 Builder state(CordVtnNodeState state);
Hyunsun Moon81a13562016-08-04 13:48:08 -0700206 }
Hyunsun Moon4edb0172015-11-07 22:08:43 -0800207}