2 * Copyright 2016 Huawei Technologies Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.openo.nfvo.jujuvnfmadapter.service.entity;
19 import java.io.Serializable;
20 import java.util.List;
22 import org.openo.nfvo.jujuvnfmadapter.common.EntityUtils;
27 * The request parameters of Register service to the Microservice Bus
28 * URL-path: /openoapi/microservices/v1/services
31 * "serviceName": "catalog",
33 * "url": "/openoapi/catalog/v1",
35 * "visualRange": ["1"],
38 * "ip": "10.74.56.36",
46 * the response example:
48 * "serviceName": "catalog",
50 * "url": "/openoapi/catalog/v1",
52 * "visualRange": ["1"],
55 * "ip": "10.74.55.66",
58 * "expiration": "2016-02-18T16:19:40+08:00",
59 * "created_at": "2016-02-18T16:03:00+08:00",
60 * "updated_at": "2016-02-18T16:03:00+08:00"
63 * "ip": "10.74.56.37",
66 * "expiration": "2016-02-18T16:13:00+08:00",
67 * "created_at": "2016-02-18T16:03:00+08:00",
68 * "updated_at": "2016-02-18T16:03:00+08:00"
71 * "ip": "10.74.56.36",
74 * "expiration": "2016-02-18T17:04:36+08:00",
75 * "created_at": "2016-02-18T16:03:00+08:00",
76 * "updated_at": "2016-02-18T16:03:00+08:00"
81 * the params description:
82 * serviceName: service name
84 * url: url of the created service instance
85 * protocol: supported protocols: 'REST', 'UI'
86 * nodes: the service instance nodes list to register
87 * ip: the ip of the service instance node, it could also be a hostname like catalog.openo.org
88 * port: the port of the service instance node
89 * ttl: time to live, this parameter is reserved for later use
90 * status: service status, 1: eanbled, 0:disabled
94 * @version NFVO 0.5 Aug 18, 2016
96 public class MSBRequestEntity implements Serializable {
101 private static final long serialVersionUID = -4548158998952436572L;
103 private String serviceName;
105 private String version;
108 * the actual URL of the service to be registered
113 * supported protocols: 'REST', 'UI'
115 private String protocol = "REST";
118 * Visibility of the service.
119 * External(can be accessed by external systems):0
120 * Internal(can only be accessed by OPEN-O consumers):1
122 private String visualRange = "1";
125 * only exist in response;
126 * status: service status, 1: eanbled, 0:disabled
128 private String status;
131 * ip: the ip of the service instance node, it could also be a hostname like catalog.openo.org
132 * port: the port of the service instance node
133 * ttl: time to live, this parameter is reserved for later use
135 private List<Node> nodes;
138 * @return Returns the serviceName.
140 public String getServiceName() {
145 * @param serviceName The serviceName to set.
147 public void setServiceName(String serviceName) {
148 this.serviceName = serviceName;
152 * @return Returns the version.
154 public String getVersion() {
159 * @param version The version to set.
161 public void setVersion(String version) {
162 this.version = version;
166 * @return Returns the url.
168 public String getUrl() {
173 * @param url The url to set.
175 public void setUrl(String url) {
180 * @return Returns the protocol.
182 public String getProtocol() {
187 * @param protocol The protocol to set.
189 public void setProtocol(String protocol) {
190 this.protocol = protocol;
194 * @return Returns the visualRange.
196 public String getVisualRange() {
201 * @param visualRange The visualRange to set.
203 public void setVisualRange(String visualRange) {
204 this.visualRange = visualRange;
208 * @return Returns the status.
210 public String getStatus() {
215 * @param status The status to set.
217 public void setStatus(String status) {
218 this.status = status;
222 * @return Returns the nodes.
224 public List<Node> getNodes() {
229 * @param nodes The nodes to set.
231 public void setNodes(List<Node> nodes) {
241 * @version NFVO 0.5 Aug 18, 2016
243 public static class Node implements Serializable {
248 private static final long serialVersionUID = 7618395945064516270L;
256 private String expiration;
258 private String createdAt;
260 private String updatedAt;
263 * @return Returns the ip.
265 public String getIp() {
270 * @param ip The ip to set.
272 public void setIp(String ip) {
277 * @return Returns the port.
279 public String getPort() {
284 * @param port The port to set.
286 public void setPort(String port) {
291 * @return Returns the ttl.
293 public String getTtl() {
298 * @param ttl The ttl to set.
300 public void setTtl(String ttl) {
305 * @return Returns the expiration.
307 public String getExpiration() {
312 * @param expiration The expiration to set.
314 public void setExpiration(String expiration) {
315 this.expiration = expiration;
319 * @return Returns the created_at.
321 public String getCreatedAt() {
326 * @param createdAt The created_at to set.
328 public void setCreatedAt(String createdAt) {
329 this.createdAt = createdAt;
333 * @return Returns the updated_at.
335 public String getUpdatedAt() {
340 * @param updatedAt The updated_at to set.
342 public void setUpdatedAt(String updatedAt) {
343 this.updatedAt = updatedAt;
353 public String toString() {
354 return EntityUtils.toString(this, Node.class);
366 public String toString() {
367 return EntityUtils.toString(this, MSBRequestEntity.class);