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/23 01:59:07 UTC

[1/2] git commit: api: Annotate storage pool related apis

Updated Branches:
  refs/heads/api_refactoring 7e3c0ec00 -> 93532ea28


api: Annotate storage pool related apis

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/93532ea2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/93532ea2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/93532ea2

Branch: refs/heads/api_refactoring
Commit: 93532ea28c8773f8e1039427096b2bf93cbdc8cf
Parents: a7e6172
Author: Rohit Yadav <bh...@apache.org>
Authored: Sat Dec 22 16:58:12 2012 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Sat Dec 22 16:58:12 2012 -0800

----------------------------------------------------------------------
 .../CancelPrimaryStorageMaintenanceCmd.java        |    5 +--
 .../admin/storagepool/CreateStoragePoolCmd.java    |   16 ++++++-----
 .../command/admin/storagepool/DeletePoolCmd.java   |    4 ++-
 .../admin/storagepool/ListStoragePoolsCmd.java     |   20 ++++++++------
 .../PreparePrimaryStorageForMaintenanceCmd.java    |    5 +--
 .../admin/storagepool/UpdateStoragePoolCmd.java    |    5 +--
 6 files changed, 29 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/93532ea2/api/src/org/apache/cloudstack/api/command/admin/storagepool/CancelPrimaryStorageMaintenanceCmd.java
----------------------------------------------------------------------
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 66fe965..c47691d 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;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/93532ea2/api/src/org/apache/cloudstack/api/command/admin/storagepool/CreateStoragePoolCmd.java
----------------------------------------------------------------------
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 506f766..d9f1d24 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;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/93532ea2/api/src/org/apache/cloudstack/api/command/admin/storagepool/DeletePoolCmd.java
----------------------------------------------------------------------
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 f2ab4d2..bc14ca3 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 " +

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/93532ea2/api/src/org/apache/cloudstack/api/command/admin/storagepool/ListStoragePoolsCmd.java
----------------------------------------------------------------------
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 74ea191..12a2dc3 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;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/93532ea2/api/src/org/apache/cloudstack/api/command/admin/storagepool/PreparePrimaryStorageForMaintenanceCmd.java
----------------------------------------------------------------------
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 2b26934..e511487 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;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/93532ea2/api/src/org/apache/cloudstack/api/command/admin/storagepool/UpdateStoragePoolCmd.java
----------------------------------------------------------------------
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 62aa5da..bfaff43 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")