Repository navigation
Expand file tree
/
Copy pathVolumeResponse.java
More file actions
executable file
·304 lines (233 loc) · 9.65 KB
/
Copy pathVolumeResponse.java
File metadata and controls
executable file
·304 lines (233 loc) · 9.65 KB
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
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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.
package com.cloud.api.response;
import java.util.Date;
import java.util.List;
import com.cloud.api.ApiConstants;
import com.cloud.serializer.Param;
import com.cloud.utils.IdentityProxy;
import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class VolumeResponse extends BaseResponse implements ControlledEntityResponse{
@SerializedName(ApiConstants.ID)
@Param(description = "ID of the disk volume")
private IdentityProxy id = new IdentityProxy("volumes");
@SerializedName(ApiConstants.NAME)
@Param(description = "name of the disk volume")
private String name;
@SerializedName(ApiConstants.ZONE_ID)
@Param(description = "ID of the availability zone")
private IdentityProxy zoneId = new IdentityProxy("data_center");
@SerializedName(ApiConstants.ZONE_NAME)
@Param(description = "name of the availability zone")
private String zoneName;
@SerializedName(ApiConstants.TYPE)
@Param(description = "type of the disk volume (ROOT or DATADISK)")
private String volumeType;
@SerializedName(ApiConstants.DEVICE_ID)
@Param(description = "the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.")
private Long deviceId;
@SerializedName(ApiConstants.VIRTUAL_MACHINE_ID)
@Param(description = "id of the virtual machine")
private IdentityProxy virtualMachineId = new IdentityProxy("vm_instance");
@SerializedName("vmname")
@Param(description = "name of the virtual machine")
private String virtualMachineName;
@SerializedName("vmdisplayname")
@Param(description = "display name of the virtual machine")
private String virtualMachineDisplayName;
@SerializedName("vmstate")
@Param(description = "state of the virtual machine")
private String virtualMachineState;
@SerializedName(ApiConstants.SIZE)
@Param(description = "size of the disk volume")
private Long size;
@SerializedName(ApiConstants.CREATED)
@Param(description = "the date the disk volume was created")
private Date created;
@SerializedName(ApiConstants.STATE)
@Param(description = "the state of the disk volume")
private String state;
@SerializedName(ApiConstants.ACCOUNT)
@Param(description = "the account associated with the disk volume")
private String accountName;
@SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vpn")
private IdentityProxy projectId = new IdentityProxy("projects");
@SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vpn")
private String projectName;
@SerializedName(ApiConstants.DOMAIN_ID)
@Param(description = "the ID of the domain associated with the disk volume")
private IdentityProxy domainId = new IdentityProxy("domain");
@SerializedName(ApiConstants.DOMAIN)
@Param(description = "the domain associated with the disk volume")
private String domainName;
@SerializedName("storagetype")
@Param(description = "shared or local storage")
private String storageType;
@SerializedName(ApiConstants.HYPERVISOR)
@Param(description = "Hypervisor the volume belongs to")
private String hypervisor;
@SerializedName(ApiConstants.DISK_OFFERING_ID)
@Param(description = "ID of the disk offering")
private IdentityProxy diskOfferingId = new IdentityProxy("disk_offering");
@SerializedName("diskofferingname")
@Param(description = "name of the disk offering")
private String diskOfferingName;
@SerializedName("diskofferingdisplaytext")
@Param(description = "the display text of the disk offering")
private String diskOfferingDisplayText;
@SerializedName("storage")
@Param(description = "name of the primary storage hosting the disk volume")
private String storagePoolName;
@SerializedName(ApiConstants.SNAPSHOT_ID)
@Param(description = "ID of the snapshot from which this volume was created")
private IdentityProxy snapshotId = new IdentityProxy("snapshots");
@SerializedName("attached")
@Param(description = "the date the volume was attached to a VM instance")
private Date attached;
@SerializedName("destroyed")
@Param(description = "the boolean state of whether the volume is destroyed or not")
private Boolean destroyed;
@SerializedName(ApiConstants.SERVICE_OFFERING_ID)
@Param(description = "ID of the service offering for root disk")
private IdentityProxy serviceOfferingId = new IdentityProxy("disk_offering");
@SerializedName("serviceofferingname")
@Param(description = "name of the service offering for root disk")
private String serviceOfferingName;
@SerializedName("serviceofferingdisplaytext")
@Param(description = "the display text of the service offering for root disk")
private String serviceOfferingDisplayText;
@SerializedName("isextractable")
@Param(description = "true if the volume is extractable, false otherwise")
private Boolean extractable;
@SerializedName(ApiConstants.STATUS)
@Param(description="the status of the volume")
private String status;
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with volume", responseObject = ResourceTagResponse.class)
private List<ResourceTagResponse> tags;
@Override
public Long getObjectId() {
return getId();
}
public Boolean getDestroyed() {
return destroyed;
}
public void setDestroyed(Boolean destroyed) {
this.destroyed = destroyed;
}
public Long getId() {
return id.getValue();
}
public void setId(Long id) {
this.id.setValue(id);
}
public void setName(String name) {
this.name = name;
}
public void setZoneId(Long zoneId) {
this.zoneId.setValue(zoneId);
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public void setVolumeType(String volumeType) {
this.volumeType = volumeType;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public void setVirtualMachineId(Long virtualMachineId) {
this.virtualMachineId.setValue(virtualMachineId);
}
public void setVirtualMachineName(String virtualMachineName) {
this.virtualMachineName = virtualMachineName;
}
public void setVirtualMachineDisplayName(String virtualMachineDisplayName) {
this.virtualMachineDisplayName = virtualMachineDisplayName;
}
public void setVirtualMachineState(String virtualMachineState) {
this.virtualMachineState = virtualMachineState;
}
public void setSize(Long size) {
this.size = size;
}
public void setCreated(Date created) {
this.created = created;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public void setDomainId(Long domainId) {
this.domainId.setValue(domainId);
}
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public void setStorageType(String storageType) {
this.storageType = storageType;
}
public void setHypervisor(String hypervisor) {
this.hypervisor = hypervisor;
}
public void setDiskOfferingId(Long diskOfferingId) {
this.diskOfferingId.setValue(diskOfferingId);
}
public void setDiskOfferingName(String diskOfferingName) {
this.diskOfferingName = diskOfferingName;
}
public void setDiskOfferingDisplayText(String diskOfferingDisplayText) {
this.diskOfferingDisplayText = diskOfferingDisplayText;
}
public void setStoragePoolName(String storagePoolName) {
this.storagePoolName = storagePoolName;
}
public void setSnapshotId(Long snapshotId) {
this.snapshotId.setValue(snapshotId);
}
public void setAttached(Date attached) {
this.attached = attached;
}
public void setServiceOfferingId(Long serviceOfferingId) {
this.serviceOfferingId.setValue(serviceOfferingId);
}
public void setServiceOfferingName(String serviceOfferingName) {
this.serviceOfferingName = serviceOfferingName;
}
public void setStatus(String status) {
this.status = status;
}
public void setServiceOfferingDisplayText(String serviceOfferingDisplayText) {
this.serviceOfferingDisplayText = serviceOfferingDisplayText;
}
public void setExtractable(Boolean extractable) {
this.extractable = extractable;
}
public void setState(String state) {
this.state = state;
}
@Override
public void setProjectId(Long projectId) {
this.projectId.setValue(projectId);
}
@Override
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public void setTags(List<ResourceTagResponse> tags) {
this.tags = tags;
}
}