summaryrefslogtreecommitdiffstats
path: root/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java
blob: 70b7f886dfbc75b57f0790241d5a5f303354a31b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
/*-
 * ============LICENSE_START=======================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package com.woorea.openstack.nova.model;

import java.io.Serializable;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;

@JsonRootName("server")
public class Server implements Serializable {

    public static final class Addresses implements Serializable {

        public static final class Address implements Serializable {

            @JsonProperty("OS-EXT-IPS-MAC:mac_addr")
            private String macAddr;

            private String version;

            private String addr;

            @JsonProperty("OS-EXT-IPS:type")
            private String type;

            /**
             * @return the macAddr
             */
            public String getMacAddr() {
                return macAddr;
            }

            /**
             * @return the version
             */
            public String getVersion() {
                return version;
            }

            /**
             * @return the addr
             */
            public String getAddr() {
                return addr;
            }


            /**
             * @return the type
             */
            public String getType() {
                return type;
            }

            /**
             * @param version the version to set
             */
            public void setVersion(String version) {
                this.version = version;
            }

            /**
             * @param addr the addr to set
             */
            public void setAddr(String addr) {
                this.addr = addr;
            }

            /**
             * @param type the type to set
             */
            public void setType(String type) {
                this.type = type;
            }

            /**
             * @param macAddr the mac addr to set
             */
            public void setMacAddr(String macAddr) {
                this.macAddr = macAddr;
            }
        }

        private Map<String, List<Address>> addresses = new HashMap<>();

        @JsonAnySetter
        public void add(String key, List<Address> value) {
            addresses.put(key, value);
        }

        /**
         * @return the ip address List Map
         */
        public Map<String, List<Address>> getAddresses() {
            return addresses;
        }

        /*
         * (non-Javadoc)
         * 
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString() {
            return "Addresses List Map [" + addresses + "]";
        }

    }

    public static final class Fault {

        private Integer code;

        private String message;

        private String details;

        private Calendar created;

        /**
         * @return the code
         */
        public Integer getCode() {
            return code;
        }

        /**
         * @return the message
         */
        public String getMessage() {
            return message;
        }

        /**
         * @return the details
         */
        public String getDetails() {
            return details;
        }

        /**
         * @return the created
         */
        public Calendar getCreated() {
            return created;
        }

        /*
         * (non-Javadoc)
         * 
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString() {
            return "Fault [code=" + code + ", message=" + message + ", details=" + details + ", created=" + created
                    + "]";
        }


    }


    private String id;

    private String name;

    private Addresses addresses;

    private List<Link> links;

    private Image image;

    private Flavor flavor;

    private String accessIPv4;

    private String accessIPv6;

    @JsonProperty("config_drive")
    private String configDrive;

    private String status;

    private Integer progress;

    private Fault fault;

    @JsonProperty("tenant_id")
    private String tenantId;

    @JsonProperty("user_id")
    private String userId;

    @JsonProperty("key_name")
    private String keyName;

    private String hostId;

    private String updated;

    private String created;

    private Map<String, String> metadata;

    @JsonProperty("security_groups")
    private List<SecurityGroup> securityGroups;

    @JsonProperty("OS-EXT-STS:task_state")
    private String taskState;

    @JsonProperty("OS-EXT-STS:power_state")
    private String powerState;

    @JsonProperty("OS-EXT-STS:vm_state")
    private String vmState;

    @JsonProperty("OS-EXT-SRV-ATTR:host")
    private String host;

    @JsonProperty("OS-EXT-SRV-ATTR:instance_name")
    private String instanceName;

    @JsonProperty("OS-EXT-SRV-ATTR:hypervisor_hostname")
    private String hypervisorHostname;

    @JsonProperty("OS-DCF:diskConfig")
    private String diskConfig;

    @JsonProperty("OS-EXT-AZ:availability_zone")
    private String availabilityZone;

    @JsonProperty("OS-SRV-USG:launched_at")
    private String launchedAt;

    @JsonProperty("OS-SRV-USG:terminated_at")
    private String terminatedAt;

    @JsonProperty("os-extended-volumes:volumes_attached")
    private List<String> osExtendedVolumesAttached;

    private String uuid;

    private String adminPass;

    /**
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the addresses
     */
    public Addresses getAddresses() {
        return addresses;
    }

    /**
     * @return the links
     */
    public List<Link> getLinks() {
        return links;
    }

    /**
     * @return the image
     */
    public Image getImage() {
        return image;
    }

    /**
     * @param image the image to set
     */
    public void setImage(Image image) {
        this.image = image;
    }

    /**
     * @return the flavor
     */
    public Flavor getFlavor() {
        return flavor;
    }

    /**
     * @param flavor the flavor to set
     */
    public void setFlavor(Flavor flavor) {
        this.flavor = flavor;
    }

    /**
     * @return the accessIPv4
     */
    public String getAccessIPv4() {
        return accessIPv4;
    }

    /**
     * @return the accessIPv6
     */
    public String getAccessIPv6() {
        return accessIPv6;
    }

    /**
     * @return the configDrive
     */
    public String getConfigDrive() {
        return configDrive;
    }

    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @return the progress
     */
    public Integer getProgress() {
        return progress;
    }

    /**
     * @return the fault
     */
    public Fault getFault() {
        return fault;
    }

    /**
     * @return the tenantId
     */
    public String getTenantId() {
        return tenantId;
    }

    /**
     * @return the userId
     */
    public String getUserId() {
        return userId;
    }

    /**
     * @return the keyName
     */
    public String getKeyName() {
        return keyName;
    }

    /**
     * @return the hostId
     */
    public String getHostId() {
        return hostId;
    }

    /**
     * @return the updated
     */
    public String getUpdated() {
        return updated;
    }

    /**
     * @return the created
     */
    public String getCreated() {
        return created;
    }

    /**
     * @return the metadata
     */
    public Map<String, String> getMetadata() {
        return metadata;
    }

    /**
     * @return the securityGroups
     */
    public List<SecurityGroup> getSecurityGroups() {
        return securityGroups;
    }

    /**
     * @return the taskState
     */
    public String getTaskState() {
        return taskState;
    }

    /**
     * @return the powerState
     */
    public String getPowerState() {
        return powerState;
    }

    /**
     * @return the vmState
     */
    public String getVmState() {
        return vmState;
    }

    /**
     * @return the host
     */
    public String getHost() {
        return host;
    }

    /**
     * @return the instanceName
     */
    public String getInstanceName() {
        return instanceName;
    }

    /**
     * @return the hypervisorHostname
     */
    public String getHypervisorHostname() {
        return hypervisorHostname;
    }

    /**
     * @return the diskConfig
     */
    public String getDiskConfig() {
        return diskConfig;
    }

    /**
     * @return the availabilityZone
     */
    public String getAvailabilityZone() {
        return availabilityZone;
    }

    /**
     * @return the launchedAt
     */
    public String getLaunchedAt() {
        return launchedAt;
    }

    /**
     * @return the terminatedAt
     */
    public String getTerminatedAt() {
        return terminatedAt;
    }

    /**
     * @return the osExtendedVolumesAttached
     */
    public List<String> getOsExtendedVolumesAttached() {
        return osExtendedVolumesAttached;
    }

    /**
     * @return the uuid
     */
    public String getUuid() {
        return uuid;
    }

    /**
     * @return the adminPass
     */
    public String getAdminPass() {
        return adminPass;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "Server [id=" + id + ", name=" + name + ", addresses=" + addresses + ", links=" + links + ", image="
                + image + ", flavor=" + flavor + ", accessIPv4=" + accessIPv4 + ", accessIPv6=" + accessIPv6
                + ", configDrive=" + configDrive + ", status=" + status + ", progress=" + progress + ", fault=" + fault
                + ", tenantId=" + tenantId + ", userId=" + userId + ", keyName=" + keyName + ", hostId=" + hostId
                + ", updated=" + updated + ", created=" + created + ", metadata=" + metadata + ", securityGroups="
                + securityGroups + ", taskState=" + taskState + ", powerState=" + powerState + ", vmState=" + vmState
                + ", host=" + host + ", instanceName=" + instanceName + ", hypervisorHostname=" + hypervisorHostname
                + ", diskConfig=" + diskConfig + ", availabilityZone=" + availabilityZone + ", launchedAt=" + launchedAt
                + ", terminatedAt=" + ", " + "osExtendedVolumesAttached=" + osExtendedVolumesAttached + ", uuid=" + uuid
                + ", adminPass=" + adminPass + "]";
    }

}