diff --git a/api/src/org/apache/cloudstack/api/command/admin/storagepool/CancelPrimaryStorageMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storagepool/CancelPrimaryStorageMaintenanceCmd.java index 66fe965f0e9..c47691d14b5 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storagepool/CancelPrimaryStorageMaintenanceCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storagepool/CancelPrimaryStorageMaintenanceCmd.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; @@ -43,8 +42,8 @@ public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="storage_pool") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the primary storage ID") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class, + required=true, description="the primary storage ID") private Long id; diff --git a/api/src/org/apache/cloudstack/api/command/admin/storagepool/CreateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storagepool/CreateStoragePoolCmd.java index 506f766840a..d9f1d24f9c1 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storagepool/CreateStoragePoolCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storagepool/CreateStoragePoolCmd.java @@ -19,11 +19,13 @@ package org.apache.cloudstack.api.command.admin.storagepool; import java.net.UnknownHostException; import java.util.Map; +import org.apache.cloudstack.api.response.ClusterResponse; +import org.apache.cloudstack.api.response.PodResponse; +import org.apache.cloudstack.api.response.ZoneResponse; import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; 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 +46,8 @@ public class CreateStoragePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="cluster") - @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, required=true, description="the cluster ID for the storage pool") + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType = ClusterResponse.class, + required=true, description="the cluster ID for the storage pool") private Long clusterId; @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the storage pool") @@ -54,8 +56,8 @@ public class CreateStoragePoolCmd extends BaseCmd { @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name for the storage pool") private String storagePoolName; - @IdentityMapper(entityTableName="host_pod_ref") - @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the storage pool") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType = PodResponse.class, + required=true, description="the Pod ID for the storage pool") private Long podId; @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for the storage pool") @@ -64,8 +66,8 @@ public class CreateStoragePoolCmd extends BaseCmd { @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL of the storage pool") private String url; - @IdentityMapper(entityTableName="data_center") - @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the storage pool") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class, + required=true, description="the Zone ID for the storage pool") private Long zoneId; ///////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/command/admin/storagepool/DeletePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storagepool/DeletePoolCmd.java index f2ab4d2f66c..bc14ca30fdd 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storagepool/DeletePoolCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storagepool/DeletePoolCmd.java @@ -16,6 +16,7 @@ // under the License. package org.apache.cloudstack.api.command.admin.storagepool; +import org.apache.cloudstack.api.response.StoragePoolResponse; import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; @@ -39,7 +40,8 @@ public class DeletePoolCmd extends BaseCmd { // /////////////////////////////////////////////////// @IdentityMapper(entityTableName="storage_pool") - @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "Storage pool id") + @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = StoragePoolResponse.class, + required = true, description = "Storage pool id") private Long id; @Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force destroy storage pool " + diff --git a/api/src/org/apache/cloudstack/api/command/admin/storagepool/ListStoragePoolsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storagepool/ListStoragePoolsCmd.java index 74ea191795b..12a2dc31c44 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storagepool/ListStoragePoolsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storagepool/ListStoragePoolsCmd.java @@ -23,11 +23,13 @@ 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.ClusterResponse; 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.ZoneResponse; import com.cloud.async.AsyncJob; import com.cloud.storage.StoragePool; import com.cloud.utils.Pair; @@ -42,8 +44,8 @@ public class ListStoragePoolsCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="cluster") - @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="list storage pools belongig to the specific cluster") + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType = ClusterResponse.class, + description="list storage pools belongig to the specific cluster") private Long clusterId; @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, description="the IP address for the storage pool") @@ -55,16 +57,16 @@ public class ListStoragePoolsCmd extends BaseListCmd { @Parameter(name=ApiConstants.PATH, type=CommandType.STRING, description="the storage pool path") private String path; - @IdentityMapper(entityTableName="host_pod_ref") - @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the storage pool") + @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType = PodResponse.class, + description="the Pod ID for the storage pool") private Long podId; - @IdentityMapper(entityTableName="data_center") - @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the storage pool") + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class, + description="the Zone ID for the storage pool") private Long zoneId; - @IdentityMapper(entityTableName="storage_pool") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the storage pool") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class, + description="the ID of the storage pool") private Long id; ///////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/command/admin/storagepool/PreparePrimaryStorageForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storagepool/PreparePrimaryStorageForMaintenanceCmd.java index 2b269346b0d..e5114873f51 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storagepool/PreparePrimaryStorageForMaintenanceCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storagepool/PreparePrimaryStorageForMaintenanceCmd.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; @@ -43,8 +42,8 @@ public class PreparePrimaryStorageForMaintenanceCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="storage_pool") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Primary storage ID") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class, + required=true, description="Primary storage ID") private Long id; ///////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/command/admin/storagepool/UpdateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storagepool/UpdateStoragePoolCmd.java index 62aa5da5d5a..bfaff43c8f1 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storagepool/UpdateStoragePoolCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storagepool/UpdateStoragePoolCmd.java @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.ApiConstants; 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; @@ -40,8 +39,8 @@ public class UpdateStoragePoolCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @IdentityMapper(entityTableName="storage_pool") - @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the Id of the storage pool") + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class, + required=true, description="the Id of the storage pool") private Long id; @Parameter(name=ApiConstants.TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma-separated list of tags for the storage pool")