Updated Branches: refs/heads/api_refactoring 30941c2d3 -> fa7527b77
API_refactoring Add parameter annotation to the admin virtual machine group. modified: api/src/org/apache/cloudstack/api/admin/vm/command/AssignVMCmd.java modified: api/src/org/apache/cloudstack/api/admin/vm/command/MigrateVMCmd.java modified: api/src/org/apache/cloudstack/api/admin/vm/command/RecoverVMCmd.java Signed-off-by: Rohit Yadav <bhais...@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/fa7527b7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/fa7527b7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/fa7527b7 Branch: refs/heads/api_refactoring Commit: fa7527b77ec0bac987629df9dc31b9808378ed18 Parents: 30941c2 Author: Fang Wang <fang.w...@citrix.com> Authored: Fri Dec 7 16:51:37 2012 -0800 Committer: Rohit Yadav <bhais...@apache.org> Committed: Fri Dec 7 17:08:33 2012 -0800 ---------------------------------------------------------------------- .../api/admin/vm/command/AssignVMCmd.java | 20 +++++++++------ .../api/admin/vm/command/MigrateVMCmd.java | 11 +++++--- .../api/admin/vm/command/RecoverVMCmd.java | 4 +- 3 files changed, 21 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fa7527b7/api/src/org/apache/cloudstack/api/admin/vm/command/AssignVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/admin/vm/command/AssignVMCmd.java b/api/src/org/apache/cloudstack/api/admin/vm/command/AssignVMCmd.java index 57b87fa..5ae6140 100644 --- a/api/src/org/apache/cloudstack/api/admin/vm/command/AssignVMCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/vm/command/AssignVMCmd.java @@ -28,6 +28,10 @@ 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.DomainResponse; +import com.cloud.api.response.NetworkResponse; +import com.cloud.api.response.SecurityGroupResponse; import com.cloud.api.response.UserVmResponse; import com.cloud.user.Account; import com.cloud.uservm.UserVm; @@ -42,24 +46,24 @@ public class AssignVMCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the vm ID of the user VM to be moved") + //@IdentityMapper(entityTableName="vm_instance") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the vm ID of the user VM to be moved", entityType=UserVmResponse.class) private Long virtualMachineId; @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="account name of the new VM owner.") private String accountName; - @IdentityMapper(entityTableName="domain") - @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="domain id of the new VM owner.") + //@IdentityMapper(entityTableName="domain") + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="domain id of the new VM owner.", entityType=DomainResponse.class) private Long domainId; //Network information - @IdentityMapper(entityTableName="networks") - @Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids that will be part of VM network after move in advanced network setting.") + //@IdentityMapper(entityTableName="networks") + @Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids that will be part of VM network after move in advanced network setting.", entityType=NetworkResponse.class) private List<Long> networkIds; - @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 moved in a zone with Basic Network support.") + //@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 moved in a zone with Basic Network support.", entityType=SecurityGroupResponse.class) private List<Long> securityGroupIdList; ///////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fa7527b7/api/src/org/apache/cloudstack/api/admin/vm/command/MigrateVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/admin/vm/command/MigrateVMCmd.java b/api/src/org/apache/cloudstack/api/admin/vm/command/MigrateVMCmd.java index 57cd8fe..6103a86 100644 --- a/api/src/org/apache/cloudstack/api/admin/vm/command/MigrateVMCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/vm/command/MigrateVMCmd.java @@ -25,6 +25,9 @@ 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.StoragePoolResponse; import com.cloud.api.response.UserVmResponse; import com.cloud.event.EventTypes; import com.cloud.exception.ConcurrentOperationException; @@ -49,16 +52,16 @@ public class MigrateVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="host") - @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, required=false, description="Destination Host ID to migrate VM to. Required for live migrating a VM from host to host") + //@IdentityMapper(entityTableName="host") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, required=false, description="Destination Host ID to migrate VM to. Required for live migrating a VM from host to host", entityType=HostResponse.class) private Long hostId; @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine", entityType=UserVmResponse.class) private Long virtualMachineId; @IdentityMapper(entityTableName="storage_pool") - @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, required=false, description="Destination storage pool ID to migrate VM volumes to. Required for migrating the root disk volume") + @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, required=false, description="Destination storage pool ID to migrate VM volumes to. Required for migrating the root disk volume", entityType=StoragePoolResponse.class) private Long storageId; ///////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fa7527b7/api/src/org/apache/cloudstack/api/admin/vm/command/RecoverVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/admin/vm/command/RecoverVMCmd.java b/api/src/org/apache/cloudstack/api/admin/vm/command/RecoverVMCmd.java index 5baa67f..c10907c 100644 --- a/api/src/org/apache/cloudstack/api/admin/vm/command/RecoverVMCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/vm/command/RecoverVMCmd.java @@ -39,8 +39,8 @@ public class RecoverVMCmd 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; /////////////////////////////////////////////////////