Repository navigation
Expand file tree
/
Copy pathUserVmResponse.java
More file actions
executable file
·358 lines (264 loc) · 12.6 KB
/
Copy pathUserVmResponse.java
File metadata and controls
executable file
·358 lines (264 loc) · 12.6 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
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
// 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 UserVmResponse extends BaseResponse implements ControlledEntityResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the virtual machine")
private IdentityProxy id = new IdentityProxy("vm_instance");
@SerializedName(ApiConstants.NAME) @Param(description="the name of the virtual machine")
private String name;
@SerializedName("displayname") @Param(description="user generated name. The name of the virtual machine is returned if no displayname exists.")
private String displayName;
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the account associated with the virtual machine")
private String accountName;
@SerializedName(ApiConstants.PROJECT_ID) @Param(description="the project id of the vm")
private IdentityProxy projectId = new IdentityProxy("projects");
@SerializedName(ApiConstants.PROJECT) @Param(description="the project name of the vm")
private String projectName;
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the ID of the domain in which the virtual machine exists")
private IdentityProxy domainId = new IdentityProxy("domain");
@SerializedName(ApiConstants.DOMAIN) @Param(description="the name of the domain in which the virtual machine exists")
private String domainName;
@SerializedName(ApiConstants.CREATED) @Param(description="the date when this virtual machine was created")
private Date created;
@SerializedName(ApiConstants.STATE) @Param(description="the state of the virtual machine")
private String state;
@SerializedName(ApiConstants.HA_ENABLE) @Param(description="true if high-availability is enabled, false otherwise")
private Boolean haEnable;
@SerializedName(ApiConstants.GROUP_ID) @Param(description="the group ID of the virtual machine")
private IdentityProxy groupId = new IdentityProxy("instance_group");
@SerializedName(ApiConstants.GROUP) @Param(description="the group name of the virtual machine")
private String group;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="the ID of the availablility zone for the virtual machine")
private IdentityProxy zoneId = new IdentityProxy("data_center");
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the availability zone for the virtual machine")
private String zoneName;
@SerializedName(ApiConstants.HOST_ID) @Param(description="the ID of the host for the virtual machine")
private IdentityProxy hostId = new IdentityProxy("host");
@SerializedName("hostname") @Param(description="the name of the host for the virtual machine")
private String hostName;
@SerializedName(ApiConstants.TEMPLATE_ID) @Param(description="the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.")
private IdentityProxy templateId = new IdentityProxy("vm_template");
@SerializedName("templatename") @Param(description="the name of the template for the virtual machine")
private String templateName;
@SerializedName("templatedisplaytext") @Param(description=" an alternate display text of the template for the virtual machine")
private String templateDisplayText;
@SerializedName(ApiConstants.PASSWORD_ENABLED) @Param(description="true if the password rest feature is enabled, false otherwise")
private Boolean passwordEnabled;
@SerializedName("isoid") @Param(description="the ID of the ISO attached to the virtual machine")
private IdentityProxy isoId = new IdentityProxy("vm_template");
@SerializedName("isoname") @Param(description="the name of the ISO attached to the virtual machine")
private String isoName;
@SerializedName("isodisplaytext") @Param(description="an alternate display text of the ISO attached to the virtual machine")
private String isoDisplayText;
@SerializedName(ApiConstants.SERVICE_OFFERING_ID) @Param(description="the ID of the service offering of the virtual machine")
private IdentityProxy serviceOfferingId = new IdentityProxy("disk_offering");
@SerializedName("serviceofferingname") @Param(description="the name of the service offering of the virtual machine")
private String serviceOfferingName;
@SerializedName("forvirtualnetwork") @Param(description="the virtual network for the service offering")
private Boolean forVirtualNetwork;
@SerializedName(ApiConstants.CPU_NUMBER) @Param(description="the number of cpu this virtual machine is running with")
private Integer cpuNumber;
@SerializedName(ApiConstants.CPU_SPEED) @Param(description="the speed of each cpu")
private Integer cpuSpeed;
@SerializedName(ApiConstants.MEMORY) @Param(description="the memory allocated for the virtual machine")
private Integer memory;
@SerializedName("cpuused") @Param(description="the amount of the vm's CPU currently used")
private String cpuUsed;
@SerializedName("networkkbsread") @Param(description="the incoming network traffic on the vm")
private Long networkKbsRead;
@SerializedName("networkkbswrite") @Param(description="the outgoing network traffic on the host")
private Long networkKbsWrite;
@SerializedName("guestosid") @Param(description="Os type ID of the virtual machine")
private IdentityProxy guestOsId = new IdentityProxy("guest_os");
@SerializedName("rootdeviceid") @Param(description="device ID of the root volume")
private Long rootDeviceId;
@SerializedName("rootdevicetype") @Param(description="device type of the root volume")
private String rootDeviceType;
@SerializedName("securitygroup") @Param(description="list of security groups associated with the virtual machine", responseObject = SecurityGroupResponse.class)
private List<SecurityGroupResponse> securityGroupList;
@SerializedName(ApiConstants.PASSWORD) @Param(description="the password (if exists) of the virtual machine")
private String password;
@SerializedName("nic") @Param(description="the list of nics associated with vm", responseObject = NicResponse.class)
private List<NicResponse> nics;
@SerializedName("hypervisor") @Param(description="the hypervisor on which the template runs")
private String hypervisor;
@SerializedName(ApiConstants.PUBLIC_IP_ID) @Param(description="public IP address id associated with vm via Static nat rule")
private IdentityProxy publicIpId = new IdentityProxy("user_ip_address");
@SerializedName(ApiConstants.PUBLIC_IP) @Param(description="public IP address id associated with vm via Static nat rule")
private String publicIp;
@SerializedName(ApiConstants.INSTANCE_NAME) @Param(description="instance name of the user vm; this parameter is returned to the ROOT admin only", since="3.0.1")
private String instanceName;
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with vm", responseObject = ResourceTagResponse.class)
private List<ResourceTagResponse> tags;
@SerializedName(ApiConstants.SSH_KEYPAIR) @Param(description="ssh key-pair")
private String keyPairName;
public void setHypervisor(String hypervisor) {
this.hypervisor = hypervisor;
}
public void setId(Long id) {
this.id.setValue(id);
}
public Long getId() {
return this.id.getValue();
}
public void setName(String name) {
this.name = name;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
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 setCreated(Date created) {
this.created = created;
}
public void setState(String state) {
this.state = state;
}
public void setHaEnable(Boolean haEnable) {
this.haEnable = haEnable;
}
public void setGroupId(Long groupId) {
this.groupId.setValue(groupId);
}
public void setGroup(String group) {
this.group = group;
}
public void setZoneId(Long zoneId) {
this.zoneId.setValue(zoneId);
}
public void setZoneName(String zoneName) {
this.zoneName = zoneName;
}
public void setHostId(Long hostId) {
this.hostId.setValue(hostId);
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
public void setTemplateId(Long templateId) {
this.templateId.setValue(templateId);
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public void setTemplateDisplayText(String templateDisplayText) {
this.templateDisplayText = templateDisplayText;
}
public void setPasswordEnabled(Boolean passwordEnabled) {
this.passwordEnabled = passwordEnabled;
}
public void setIsoId(Long isoId) {
this.isoId.setValue(isoId);
}
public void setIsoName(String isoName) {
this.isoName = isoName;
}
public void setIsoDisplayText(String isoDisplayText) {
this.isoDisplayText = isoDisplayText;
}
public void setServiceOfferingId(Long serviceOfferingId) {
this.serviceOfferingId.setValue(serviceOfferingId);
}
public void setServiceOfferingName(String serviceOfferingName) {
this.serviceOfferingName = serviceOfferingName;
}
public void setCpuNumber(Integer cpuNumber) {
this.cpuNumber = cpuNumber;
}
public void setCpuSpeed(Integer cpuSpeed) {
this.cpuSpeed = cpuSpeed;
}
public void setMemory(Integer memory) {
this.memory = memory;
}
public void setCpuUsed(String cpuUsed) {
this.cpuUsed = cpuUsed;
}
public void setNetworkKbsRead(Long networkKbsRead) {
this.networkKbsRead = networkKbsRead;
}
public void setNetworkKbsWrite(Long networkKbsWrite) {
this.networkKbsWrite = networkKbsWrite;
}
public void setGuestOsId(Long guestOsId) {
this.guestOsId.setValue(guestOsId);
}
public void setRootDeviceId(Long rootDeviceId) {
this.rootDeviceId = rootDeviceId;
}
public void setRootDeviceType(String rootDeviceType) {
this.rootDeviceType = rootDeviceType;
}
public void setPassword(String password) {
this.password = password;
}
/*
public void setJobId(Long jobId) {
super.setJobId(jobId);
}
public void setJobStatus(Integer jobStatus) {
this.jobStatus = jobStatus;
}
*/
public void setForVirtualNetwork(Boolean forVirtualNetwork) {
this.forVirtualNetwork = forVirtualNetwork;
}
public void setNics(List<NicResponse> nics) {
this.nics = nics;
}
public void setSecurityGroupList(List<SecurityGroupResponse> securityGroups) {
this.securityGroupList = securityGroups;
}
@Override
public void setProjectId(Long projectId) {
this.projectId.setValue(projectId);
}
@Override
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public void setPublicIpId(Long publicIpId) {
this.publicIpId.setValue(publicIpId);
}
public void setPublicIp(String publicIp) {
this.publicIp = publicIp;
}
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}
public void setTags(List<ResourceTagResponse> tags) {
this.tags = tags;
}
public void setKeyPairName(String keyPairName) {
this.keyPairName = keyPairName;
}
}