api: Annotate missing systemvm api, annotate SystemVmResponse 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/5548d08f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/5548d08f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/5548d08f Branch: refs/heads/api_refactoring Commit: 5548d08fb6eec93f11e616abc862ef52746d55b7 Parents: d9718e8 Author: Rohit Yadav <[email protected]> Authored: Thu Dec 20 01:36:53 2012 -0800 Committer: Rohit Yadav <[email protected]> Committed: Thu Dec 20 01:37:36 2012 -0800 ---------------------------------------------------------------------- .../command/admin/systemvm/ListSystemVMsCmd.java | 25 ++++++++------ .../cloudstack/api/response/SystemVmResponse.java | 3 ++ 2 files changed, 17 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5548d08f/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java index 279e1a4..f81ee06 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java @@ -23,11 +23,14 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListCmd; -import org.apache.cloudstack.api.IdentityMapper; import org.apache.cloudstack.api.Implementation; import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.response.HostResponse; import org.apache.cloudstack.api.response.ListResponse; +import org.apache.cloudstack.api.response.PodResponse; +import org.apache.cloudstack.api.response.StoragePoolResponse; import org.apache.cloudstack.api.response.SystemVmResponse; +import org.apache.cloudstack.api.response.ZoneResponse; import com.cloud.async.AsyncJob; import com.cloud.utils.Pair; import com.cloud.vm.VirtualMachine; @@ -42,19 +45,19 @@ public class ListSystemVMsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="host") - @Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID of the system VM") + @Parameter(name=ApiConstants.HOST_ID, type=CommandType.UUID, entityType=HostResponse.class, + description="the host ID of the system VM") private Long hostId; - @IdentityMapper(entityTableName="vm_instance") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the system VM") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=SystemVmResponse.class, + description="the ID of the system VM") private Long id; @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the system VM") private String systemVmName; - @IdentityMapper(entityTableName="host_pod_ref") - @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID of the system VM") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class, + description="the Pod ID of the system VM") private Long podId; @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the state of the system VM") @@ -63,12 +66,12 @@ public class ListSystemVMsCmd extends BaseListCmd { @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"consoleproxy\" and \"secondarystoragevm\".") private String systemVmType; - @IdentityMapper(entityTableName="data_center") - @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID of the system VM") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class, + description="the Zone ID of the system VM") private Long zoneId; - @IdentityMapper(entityTableName="storage_pool") - @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to", since="3.0.1") + @Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class, + description="the storage ID where vm's volumes belong to", since="3.0.1") private Long storageId; ///////////////////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5548d08f/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java b/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java index 1fa9eb4..6a8e79d 100644 --- a/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java +++ b/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java @@ -18,11 +18,14 @@ package org.apache.cloudstack.api.response; import java.util.Date; +import com.cloud.vm.VirtualMachine; import org.apache.cloudstack.api.ApiConstants; import com.cloud.serializer.Param; import com.google.gson.annotations.SerializedName; import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.Entity; +@Entity(value=VirtualMachine.class) public class SystemVmResponse extends BaseResponse { @SerializedName("id") @Param(description="the ID of the system VM") private String id;
