Updated Branches: refs/heads/api_refactoring a88ce6bb7 -> 5548d08fb
api: Annotate some systemvm commands Signed-off-by: Rohit Yadav <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d9718e82 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d9718e82 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d9718e82 Branch: refs/heads/api_refactoring Commit: d9718e82f28c2f0fb4cf2bb344b38c92db2e6baf Parents: a88ce6b Author: Fang Wang <[email protected]> Authored: Thu Dec 20 01:36:10 2012 -0800 Committer: Rohit Yadav <[email protected]> Committed: Thu Dec 20 01:37:36 2012 -0800 ---------------------------------------------------------------------- .../command/admin/systemvm/DestroySystemVmCmd.java | 5 ++--- .../command/admin/systemvm/MigrateSystemVMCmd.java | 11 ++++++----- .../command/admin/systemvm/RebootSystemVmCmd.java | 5 ++--- .../command/admin/systemvm/StartSystemVMCmd.java | 4 ++-- .../command/admin/systemvm/StopSystemVmCmd.java | 5 ++--- .../command/admin/systemvm/UpgradeSystemVMCmd.java | 11 ++++++----- .../api/response/StoragePoolResponse.java | 3 +++ 7 files changed, 23 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java index 816cbe4..f246215 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.BaseCmd; -import org.apache.cloudstack.api.IdentityMapper; import org.apache.cloudstack.api.Implementation; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; @@ -38,8 +37,8 @@ public class DestroySystemVmCmd extends BaseAsyncCmd { private static final String s_name = "destroysystemvmresponse"; - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=SystemVmResponse.class, + required=true, description="The ID of the system virtual machine") private Long id; public Long getId() { http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java index 1d20496..0406c77 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java @@ -21,10 +21,11 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.BaseCmd; -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 org.apache.cloudstack.api.response.HostResponse; +import org.apache.cloudstack.api.response.SystemVmResponse; import org.apache.cloudstack.api.response.SystemVmInstanceResponse; import com.cloud.event.EventTypes; import com.cloud.exception.ConcurrentOperationException; @@ -47,12 +48,12 @@ public class MigrateSystemVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="host") - @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, required=true, description="destination Host ID to migrate VM to") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.UUID, entityType=HostResponse.class, + required=true, description="destination Host ID to migrate VM to") 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.UUID, entityType=SystemVmResponse.class, + required=true, description="the ID of the virtual machine") private Long virtualMachineId; http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java index 9701598..edfca82 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.BaseCmd; -import org.apache.cloudstack.api.IdentityMapper; import org.apache.cloudstack.api.Implementation; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; @@ -42,8 +41,8 @@ public class RebootSystemVmCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=SystemVmResponse.class, + required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java index 9414c64..fccd4a7 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java @@ -42,8 +42,8 @@ public class StartSystemVMCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=SystemVmResponse.class, + required=true, description="The ID of the system virtual machine") private Long id; ///////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java index 654ba4f..60e2543 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.BaseCmd; -import org.apache.cloudstack.api.IdentityMapper; import org.apache.cloudstack.api.Implementation; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; @@ -44,8 +43,8 @@ public class StopSystemVmCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system virtual machine") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=SystemVmResponse.class, + required=true, description="The ID of the system virtual machine") private Long id; @Parameter(name=ApiConstants.FORCED, type=CommandType.BOOLEAN, required=false, description="Force stop the VM. The caller knows the VM is stopped.") http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java index 3383c56..d530c14 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java @@ -16,7 +16,9 @@ // under the License. package org.apache.cloudstack.api.command.admin.systemvm; +import com.cloud.offering.DiskOffering; import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd; +import org.apache.cloudstack.api.response.DiskOfferingResponse; import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; @@ -43,13 +45,12 @@ public class UpgradeSystemVMCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the system vm") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=SystemVmResponse.class, + required=true, description="The ID of the system vm") 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 system vm") + @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.UUID, entityType=DiskOfferingResponse.class, + required=true, description="the service offering ID to apply to the system vm") private Long serviceOfferingId; ///////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d9718e82/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java index 0c05236..1267668 100644 --- a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java +++ b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java @@ -18,12 +18,15 @@ package org.apache.cloudstack.api.response; import java.util.Date; +import com.cloud.storage.StoragePool; import org.apache.cloudstack.api.ApiConstants; import com.cloud.serializer.Param; import com.cloud.storage.StoragePoolStatus; import com.google.gson.annotations.SerializedName; import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.Entity; +@Entity(value=StoragePool.class) public class StoragePoolResponse extends BaseResponse { @SerializedName("id") @Param(description="the ID of the storage pool") private String id;
