1a1d65dd33d3737a25716d214df1569cdebc1b20
[msb/discovery.git] / sdclient / discovery-service / src / main / java / org / onap / msb / sdclient / core / Node.java
1 /**
2  * Copyright 2016-2018 ZTE, Inc. and others.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14 package org.onap.msb.sdclient.core;
15
16 import java.io.Serializable;
17
18 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
19
20 import io.swagger.annotations.ApiModelProperty;
21
22 @JsonIgnoreProperties(ignoreUnknown = true)
23 public class Node implements Serializable {
24     private static final long serialVersionUID = 1L;
25
26     @ApiModelProperty(example = "127.0.0.1", required = true)
27     private String ip;
28
29     @ApiModelProperty(example = "80", required = true)
30     private String port;
31
32
33     // loadbalance policy parameter
34     @ApiModelProperty(value = "lb node params", allowableValues = "weight,max_fails,fail_timeout",
35                     example = "weight=5,max_fails=3,fail_timeout=30s")
36     private String lb_server_params;
37
38     // health check parameter
39     @ApiModelProperty(value = "health check type", allowableValues = "TTL,HTTP,TCP", example = "TTL")
40     private String checkType = "";
41
42     @ApiModelProperty(value = "health check URL,applies only to TCP or HTTP", example = "http://localhost:5000/health")
43     private String checkUrl = "";
44
45     @ApiModelProperty(value = "TCP or HTTP health check Interval,Unit: second", example = "10s")
46     private String checkInterval;
47
48     @ApiModelProperty(value = "TCP or HTTP health check TimeOut,Unit: second", example = "10s")
49     private String checkTimeOut;
50
51     @ApiModelProperty(value = "TTL health check Interval,Unit: second", example = "10s")
52     private String ttl;
53         
54     @ApiModelProperty(value = "health check skip TLS verify, applies only to HTTPs", allowableValues = "true, false")
55         private Boolean tls_skip_verify = true;
56
57     @ApiModelProperty(value = "Instance HA_role", allowableValues = "active,standby", example = "active")
58     private String ha_role = "";
59
60
61
62     public String getHa_role() {
63         return ha_role;
64     }
65
66     public void setHa_role(String ha_role) {
67         this.ha_role = ha_role;
68     }
69
70     public String getIp() {
71         return ip;
72     }
73
74     public void setIp(String ip) {
75         this.ip = ip;
76     }
77
78     public String getPort() {
79         return port;
80     }
81
82     public void setPort(String port) {
83         this.port = port;
84     }
85
86     public String getTtl() {
87         return ttl;
88     }
89
90     public void setTtl(String ttl) {
91         this.ttl = ttl;
92     }
93
94     public Node() {
95
96     }
97
98     public Node(String ip, String port) {
99         this.ip = ip;
100         this.port = port;
101     }
102
103     public String getLb_server_params() {
104         return lb_server_params;
105     }
106
107     public void setLb_server_params(String lb_server_params) {
108         this.lb_server_params = lb_server_params;
109     }
110
111
112     public String getCheckType() {
113         return checkType;
114     }
115
116     public void setCheckType(String checkType) {
117         this.checkType = checkType;
118     }
119
120     public String getCheckUrl() {
121         return checkUrl;
122     }
123
124     public void setCheckUrl(String checkUrl) {
125         this.checkUrl = checkUrl;
126     }
127
128     public String getCheckInterval() {
129         return checkInterval;
130     }
131
132     public void setCheckInterval(String checkInterval) {
133         this.checkInterval = checkInterval;
134     }
135
136     public String getCheckTimeOut() {
137         return checkTimeOut;
138     }
139
140     public void setCheckTimeOut(String checkTimeOut) {
141         this.checkTimeOut = checkTimeOut;
142     }
143
144
145
146 }