AT&T 1712 and 1802 release code
[so.git] / cloudify-client / src / main / java / org / openecomp / mso / cloudify / v3 / model / NodeInstance.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.mso.cloudify.v3.model;
22
23 import java.io.Serializable;
24 import java.util.List;
25 import java.util.Map;
26
27 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.fasterxml.jackson.annotation.JsonRootName;
30
31 @JsonIgnoreProperties(ignoreUnknown = true)
32 @JsonRootName("node_instance")
33 public class NodeInstance implements Serializable {
34
35         private static final long serialVersionUID = 1L;
36         
37         @JsonProperty("created_by")
38     private String createdBy;
39
40     @JsonProperty("deployment_id")
41     private String deploymentId;
42
43     @JsonProperty("host_id")
44     private String hostId;
45
46     @JsonProperty("id")
47     private String id;
48     
49     @JsonProperty("node_id")
50     private String nodeId;
51     
52     @JsonProperty("relationships")
53     private List<Object> relationships = null;
54     
55     @JsonProperty("runtime_properties")
56     private Map<String, Object> runtimeProperties = null;
57     
58     @JsonProperty("scaling_groups")
59     private List<ScalingGroupIdentifier> scalingGroups;
60     
61     @JsonProperty("state")
62     private String state;
63
64     @JsonProperty("tenant_name")
65     private String tenantName;
66
67     @JsonProperty("version")
68     private String version;
69
70         public String getCreatedBy() {
71                 return createdBy;
72         }
73
74         public void setCreatedBy(String createdBy) {
75                 this.createdBy = createdBy;
76         }
77
78         public String getDeploymentId() {
79                 return deploymentId;
80         }
81
82         public void setDeploymentId(String deploymentId) {
83                 this.deploymentId = deploymentId;
84         }
85
86         public String getHostId() {
87                 return hostId;
88         }
89
90         public void setHostId(String hostId) {
91                 this.hostId = hostId;
92         }
93
94         public String getId() {
95                 return id;
96         }
97
98         public void setId(String id) {
99                 this.id = id;
100         }
101
102         public String getNodeId() {
103                 return nodeId;
104         }
105
106         public void setNodeId(String nodeId) {
107                 this.nodeId = nodeId;
108         }
109
110         public List<Object> getRelationships() {
111                 return relationships;
112         }
113
114         public void setRelationships(List<Object> relationships) {
115                 this.relationships = relationships;
116         }
117
118         public Map<String, Object> getRuntimeProperties() {
119                 return runtimeProperties;
120         }
121
122         public void setRuntimeProperties(Map<String, Object> runtimeProperties) {
123                 this.runtimeProperties = runtimeProperties;
124         }
125
126         public List<ScalingGroupIdentifier> getScalingGroups() {
127                 return scalingGroups;
128         }
129
130         public void setScalingGroups(List<ScalingGroupIdentifier> scalingGroups) {
131                 this.scalingGroups = scalingGroups;
132         }
133
134         public String getState() {
135                 return state;
136         }
137
138         public void setState(String state) {
139                 this.state = state;
140         }
141
142         public String getTenantName() {
143                 return tenantName;
144         }
145
146         public void setTenantName(String tenantName) {
147                 this.tenantName = tenantName;
148         }
149
150         public String getVersion() {
151                 return version;
152         }
153
154         public void setVersion(String version) {
155                 this.version = version;
156         }
157
158         /*
159          * Nested structure representing scaling groups in which this node is a member
160          */
161         public static final class ScalingGroupIdentifier
162         {
163                 @JsonProperty("name")
164                 private String name;
165                 
166                 @JsonProperty("id")
167                 private String id;
168                 
169                 public String getName() {
170                         return name;
171                 }
172                 public void setName(String name) {
173                         this.name = name;
174                 }
175                 public String getId() {
176                         return id;
177                 }
178                 public void setId(String id) {
179                         this.id = id;
180                 }
181                 
182                 public String toString() {
183                         return "Scaling Group{ name=" + name + ", id=" + id + "}";
184                 }
185         }
186         
187         @Override
188     public String toString() {
189         return "Deployment{" +
190                 "id='" + id + '\'' +
191                 "nodeId='" + nodeId + '\'' +
192                 ", createdBy='" + createdBy + '\'' +
193                 ", tenantName='" + tenantName + '\'' +
194                 ", state=" + state +
195                 ", deploymentId=" + deploymentId +
196                 ", hostId='" + hostId + '\'' +
197                 ", version='" + version + '\'' +
198                 ", relationships=" + relationships +
199                 ", runtimeProperties=" + runtimeProperties +
200                 ", scalingGroups=" + scalingGroups +
201                 '}';
202     }
203
204         // TODO:  Need an object structure for Relationships
205 }