You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/08 04:29:52 UTC

[25/57] git commit: api: Refactoring, add the parameter annotation for user VM.

api: Refactoring, add the parameter annotation for user VM.

- Fix some errors in the previous deployVMCmd.

	modified:   api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java
	modified:   api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java

Signed-off-by: Rohit Yadav <bh...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/ad50d226
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ad50d226
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ad50d226

Branch: refs/heads/api_refactoring
Commit: ad50d226cd5ffa3d84fb1aed33f1d581909ec6e1
Parents: af28c06
Author: Fang Wang <fa...@citrix.com>
Authored: Fri Dec 7 17:39:25 2012 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Fri Dec 7 18:33:07 2012 -0800

----------------------------------------------------------------------
 .../api/user/vm/command/DeployVMCmd.java           |   46 ++++++++-----
 .../api/user/vm/command/DestroyVMCmd.java          |    4 +-
 .../api/user/vm/command/GetVMPasswordCmd.java      |    5 +-
 .../cloudstack/api/user/vm/command/ListVMsCmd.java |   50 +++++++++------
 .../api/user/vm/command/RebootVMCmd.java           |    2 +-
 .../api/user/vm/command/ResetVMPasswordCmd.java    |    2 +-
 .../api/user/vm/command/RestoreVMCmd.java          |    2 +-
 .../cloudstack/api/user/vm/command/StartVMCmd.java |    6 +-
 .../cloudstack/api/user/vm/command/StopVMCmd.java  |    2 +-
 .../api/user/vm/command/UpdateVMCmd.java           |    6 +-
 .../api/user/vm/command/UpgradeVMCmd.java          |    6 +-
 11 files changed, 79 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
index ac67297..2cf9e8c 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java
@@ -34,7 +34,17 @@ import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
+
+import com.cloud.api.response.DiskOfferingResponse;
+import com.cloud.api.response.DomainResponse;
+import com.cloud.api.response.HostResponse;
+import com.cloud.api.response.NetworkResponse;
+import com.cloud.api.response.ProjectAccountResponse;
+import com.cloud.api.response.SecurityGroupResponse;
+import com.cloud.api.response.ServiceOfferingResponse;
+import com.cloud.api.response.TemplateResponse;
 import com.cloud.api.response.UserVmResponse;
+import com.cloud.api.response.ZoneResponse;
 import com.cloud.async.AsyncJob;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
@@ -67,18 +77,18 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine")
+    //@IdentityMapper(entityTableName="data_center")
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine", entityType=ZoneResponse.class)
     private Long zoneId;
 
     @ACL
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine", resourceType=ServiceOffering.class)
+    //@IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine", resourceType=ServiceOffering.class, entityType=ServiceOfferingResponse.class)
     private Long serviceOfferingId;
 
     @ACL
-    @IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine",resourceType=VirtualMachineTemplate.class)
+    //@IdentityMapper(entityTableName="vm_template")
+    @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine", entityType=TemplateResponse.class)
     private Long templateId;
 
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="host name for the virtual machine")
@@ -91,20 +101,20 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
     @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.")
     private String accountName;
 
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.", entityType=Domain.class)
+    //@IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.", entityType=DomainResponse.class)
     private Long domainId;
 
     //Network information
     @ACL
-    @IdentityMapper(entityTableName="networks")
-    @Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter", resourceType=Network.class)
+    //@IdentityMapper(entityTableName="networks")
+    @Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter", entityType=NetworkResponse.class)
     private List<Long> networkIds;
 
     //DataDisk information
     @ACL
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.", resourceType=DiskOffering.class)
+    //@IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.", entityType=DiskOfferingResponse.class)
     private Long diskOfferingId;
 
     @Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId")
@@ -123,13 +133,13 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
     private String sshKeyPairName;
 
 
-    @IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only")
+    //@IdentityMapper(entityTableName="host")
+    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", entityType=HostResponse.class)
     private Long hostId;
 
     @ACL
-    @IdentityMapper(entityTableName="security_group")
-    @Parameter(name=ApiConstants.SECURITY_GROUP_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter", resourceType=SecurityGroup.class)
+    //@IdentityMapper(entityTableName="security_group")
+    @Parameter(name=ApiConstants.SECURITY_GROUP_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter", resourceType=SecurityGroup.class, entityType=SecurityGroupResponse.class)
     private List<Long> securityGroupIdList;
 
     @ACL
@@ -146,8 +156,8 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
     @Parameter(name=ApiConstants.KEYBOARD, type=CommandType.STRING, description="an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us")
     private String keyboard;
 
-    @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Deploy vm for the project")
+    //@IdentityMapper(entityTableName="projects")
+    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Deploy vm for the project", entityType=ProjectAccountResponse.class)
     private Long projectId;
 
     @Parameter(name=ApiConstants.START_VM, type=CommandType.BOOLEAN, description="true if network offering supports specifying ip ranges; defaulted to true if not specified")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
index a308b69..06c3c0d 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java
@@ -45,8 +45,8 @@ public class DestroyVMCmd extends BaseAsyncCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
+    //@IdentityMapper(entityTableName="vm_instance")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
index 54464ee..ee8eee4 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java
@@ -26,6 +26,7 @@ import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
 import org.apache.cloudstack.api.Parameter;
 import com.cloud.api.response.GetVMPasswordResponse;
+import com.cloud.api.response.UserVmResponse;
 import com.cloud.user.Account;
 import com.cloud.uservm.UserVm;
 
@@ -39,8 +40,8 @@ public class GetVMPasswordCmd extends BaseCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
+    //@IdentityMapper(entityTableName="vm_instance")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
index 9ed9bb3..335a326 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java
@@ -28,8 +28,18 @@ import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
 import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
 import org.apache.cloudstack.api.Parameter;
+
+import com.cloud.api.response.HostResponse;
+import com.cloud.api.response.InstanceGroupResponse;
+import com.cloud.api.response.IsoVmResponse;
 import com.cloud.api.response.ListResponse;
+import com.cloud.api.response.NetworkResponse;
+import com.cloud.api.response.PodResponse;
+import com.cloud.api.response.StoragePoolResponse;
+import com.cloud.api.response.TemplateResponse;
 import com.cloud.api.response.UserVmResponse;
+import com.cloud.api.response.VpcResponse;
+import com.cloud.api.response.ZoneResponse;
 import com.cloud.async.AsyncJob;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.utils.Pair;
@@ -46,60 +56,60 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="instance_group")
-    @Parameter(name=ApiConstants.GROUP_ID, type=CommandType.LONG, description="the group ID")
+    //@IdentityMapper(entityTableName="instance_group")
+    @Parameter(name=ApiConstants.GROUP_ID, type=CommandType.LONG, description="the group ID", entityType=InstanceGroupResponse.class)
     private Long groupId;
 
-    @IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID")
+    //@IdentityMapper(entityTableName="host")
+    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID", entityType=HostResponse.class)
     private Long hostId;
 
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the virtual machine")
+    //@IdentityMapper(entityTableName="vm_instance")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the virtual machine")
     private String instanceName;
 
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the pod ID")
+    //@IdentityMapper(entityTableName="host_pod_ref")
+    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the pod ID", entityType=PodResponse.class)
     private Long podId;
 
     @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="state of the virtual machine")
     private String state;
 
-    @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the availability zone ID")
+    //@IdentityMapper(entityTableName="data_center")
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the availability zone ID", entityType=ZoneResponse.class)
     private Long zoneId;
 
     @Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="list by network type; true if need to list vms using Virtual Network, false otherwise")
     private Boolean forVirtualNetwork;
 
-    @IdentityMapper(entityTableName="networks")
-    @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="list by network id")
+    //@IdentityMapper(entityTableName="networks")
+    @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="list by network id", entityType=NetworkResponse.class)
     private Long networkId;
 
     @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the target hypervisor for the template")
     private String hypervisor;
 
-    @IdentityMapper(entityTableName="storage_pool")
-    @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to")
+    //@IdentityMapper(entityTableName="storage_pool")
+    @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to", entityType=StoragePoolResponse.class)
     private Long storageId;
 
     @Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of host details requested, " +
             "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]. If no parameter is passed in, the details will be defaulted to all" )
     private List<String> viewDetails;
 
-    @IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="list vms by template")
+    //@IdentityMapper(entityTableName="vm_template")
+    @Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="list vms by template", entityType=TemplateResponse.class)
     private Long templateId;
 
-    @IdentityMapper(entityTableName="vm_template")
-    @Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso")
+    //@IdentityMapper(entityTableName="vm_template")
+    @Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso", entityType=IsoVmResponse.class)
     private Long isoId;
 
-    @IdentityMapper(entityTableName="vpc")
-    @Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="list vms by vpc")
+    //@IdentityMapper(entityTableName="vpc")
+    @Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="list vms by vpc", entityType=VpcResponse.class)
     private Long vpcId;
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
index 3d496b5..45ed4ee 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java
@@ -45,7 +45,7 @@ public class RebootVMCmd extends BaseAsyncCmd {
     /////////////////////////////////////////////////////
 
     @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
index d3fab26..c41c51f 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java
@@ -47,7 +47,7 @@ public class ResetVMPasswordCmd extends BaseAsyncCmd {
     /////////////////////////////////////////////////////
 
     @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     // unexposed parameter needed for serializing/deserializing the command

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
index c4ff9aa..926362f 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java
@@ -41,7 +41,7 @@ public class RestoreVMCmd extends BaseAsyncCmd {
     private static final String s_name = "restorevmresponse";
 
     @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="Virtual Machine ID")
+    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="Virtual Machine ID", entityType=UserVmResponse.class)
     private Long vmId;
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java
index 406ffb9..f00e082 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java
@@ -25,6 +25,8 @@ import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
+
+import com.cloud.api.response.HostResponse;
 import com.cloud.api.response.UserVmResponse;
 import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
@@ -50,11 +52,11 @@ public class StartVMCmd extends BaseAsyncCmd {
     // ///////////////////////////////////////////////////
 
     @IdentityMapper(entityTableName = "vm_instance")
-    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine")
+    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     @IdentityMapper(entityTableName="host")
-    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", since="3.0.1")
+    @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", entityType=HostResponse.class, since="3.0.1")
     private Long hostId;
 
     // ///////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java
index 2de2057..53262a2 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java
@@ -45,7 +45,7 @@ public class StopVMCmd extends BaseAsyncCmd {
     // ///////////////////////////////////////////////////
 
     @IdentityMapper(entityTableName = "vm_instance")
-    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine")
+    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM " +

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java
index 2a8dfca..4b4ecf4 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java
@@ -24,6 +24,8 @@ import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
+
+import com.cloud.api.response.GuestOSResponse;
 import com.cloud.api.response.UserVmResponse;
 import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.ResourceUnavailableException;
@@ -53,11 +55,11 @@ public class UpdateVMCmd extends BaseCmd{
     private Boolean haEnable;
 
     @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     @IdentityMapper(entityTableName="guest_os")
-    @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents this VM.")
+    @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents this VM.", entityType=GuestOSResponse.class)
     private Long osTypeId;
 
     @Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.", length=2048)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ad50d226/api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java b/api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java
index 32ff918..995218e 100644
--- a/api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java
@@ -24,6 +24,8 @@ import org.apache.cloudstack.api.IdentityMapper;
 import org.apache.cloudstack.api.Implementation;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
+
+import com.cloud.api.response.DiskOfferingResponse;
 import com.cloud.api.response.UserVmResponse;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.offering.ServiceOffering;
@@ -43,11 +45,11 @@ public class UpgradeVMCmd extends BaseCmd {
     /////////////////////////////////////////////////////
 
     @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
     private Long id;
 
     @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine")
+    @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine", entityType=DiskOfferingResponse.class)
     private Long serviceOfferingId;
 
     /////////////////////////////////////////////////////