2020import java .util .EnumSet ;
2121import java .util .List ;
2222
23+ import org .apache .log4j .Logger ;
24+
2325import org .apache .cloudstack .affinity .AffinityGroupResponse ;
2426import org .apache .cloudstack .api .APICommand ;
2527import org .apache .cloudstack .api .ApiCommandJobType ;
2628import org .apache .cloudstack .api .ApiConstants ;
2729import org .apache .cloudstack .api .ApiConstants .VMDetails ;
2830import org .apache .cloudstack .api .BaseListTaggedResourcesCmd ;
2931import org .apache .cloudstack .api .Parameter ;
30- import org .apache .cloudstack .api .response . HostResponse ;
32+ import org .apache .cloudstack .api .ResponseObject . ResponseView ;
3133import org .apache .cloudstack .api .response .InstanceGroupResponse ;
3234import org .apache .cloudstack .api .response .IsoVmResponse ;
3335import org .apache .cloudstack .api .response .ListResponse ;
3436import org .apache .cloudstack .api .response .NetworkResponse ;
35- import org .apache .cloudstack .api .response .PodResponse ;
36- import org .apache .cloudstack .api .response .StoragePoolResponse ;
3737import org .apache .cloudstack .api .response .TemplateResponse ;
3838import org .apache .cloudstack .api .response .UserVmResponse ;
3939import org .apache .cloudstack .api .response .VpcResponse ;
4040import org .apache .cloudstack .api .response .ZoneResponse ;
41- import org .apache .log4j .Logger ;
4241
4342import com .cloud .exception .InvalidParameterValueException ;
4443
4544
46- @ APICommand (name = "listVirtualMachines" , description = "List the virtual machines owned by the account." , responseObject = UserVmResponse .class )
45+ @ APICommand (name = "listVirtualMachines" , description = "List the virtual machines owned by the account." , responseObject = UserVmResponse .class , responseView = ResponseView . User )
4746public class ListVMsCmd extends BaseListTaggedResourcesCmd {
4847 public static final Logger s_logger = Logger .getLogger (ListVMsCmd .class .getName ());
4948
@@ -57,21 +56,13 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
5756 description ="the group ID" )
5857 private Long groupId ;
5958
60- @ Parameter (name =ApiConstants .HOST_ID , type =CommandType .UUID , entityType =HostResponse .class ,
61- description ="the host ID" )
62- private Long hostId ;
63-
6459 @ Parameter (name =ApiConstants .ID , type =CommandType .UUID , entityType =UserVmResponse .class ,
6560 description ="the ID of the virtual machine" )
6661 private Long id ;
6762
6863 @ Parameter (name =ApiConstants .NAME , type =CommandType .STRING , description ="name of the virtual machine" )
6964 private String name ;
7065
71- @ Parameter (name =ApiConstants .POD_ID , type =CommandType .UUID , entityType =PodResponse .class ,
72- description ="the pod ID" )
73- private Long podId ;
74-
7566 @ Parameter (name =ApiConstants .STATE , type =CommandType .STRING , description ="state of the virtual machine" )
7667 private String state ;
7768
@@ -89,10 +80,6 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
8980 @ Parameter (name =ApiConstants .HYPERVISOR , type =CommandType .STRING , description ="the target hypervisor for the template" )
9081 private String hypervisor ;
9182
92- @ Parameter (name =ApiConstants .STORAGE_ID , type =CommandType .UUID , entityType =StoragePoolResponse .class ,
93- description ="the storage ID where vm's volumes belong to" )
94- private Long storageId ;
95-
9683 @ Parameter (name =ApiConstants .DETAILS , type =CommandType .LIST , collectionType =CommandType .STRING ,
9784 description ="comma separated list of host details requested, " +
9885 "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp]." +
@@ -122,10 +109,6 @@ public Long getGroupId() {
122109 return groupId ;
123110 }
124111
125- public Long getHostId () {
126- return hostId ;
127- }
128-
129112 public Long getId () {
130113 return id ;
131114 }
@@ -134,10 +117,6 @@ public String getName() {
134117 return name ;
135118 }
136119
137- public Long getPodId () {
138- return podId ;
139- }
140-
141120 public String getState () {
142121 return state ;
143122 }
@@ -162,9 +141,6 @@ public String getHypervisor() {
162141 return hypervisor ;
163142 }
164143
165- public Long getStorageId () {
166- return storageId ;
167- }
168144
169145 public Long getTemplateId () {
170146 return templateId ;
@@ -219,6 +195,6 @@ public ApiCommandJobType getInstanceType() {
219195 public void execute (){
220196 ListResponse <UserVmResponse > response = _queryService .searchForUserVMs (this );
221197 response .setResponseName (getCommandName ());
222- this . setResponseObject (response );
198+ setResponseObject (response );
223199 }
224200}
0 commit comments