api: Annotate autoscale and cluster apis

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

Branch: refs/heads/api_refactoring
Commit: fb9db2b1b19cf72ead11592bfc43f148a9f2477f
Parents: 6116f3a
Author: Rohit Yadav <[email protected]>
Authored: Tue Dec 18 13:59:11 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Tue Dec 18 13:59:11 2012 -0800

----------------------------------------------------------------------
 .../command/admin/autoscale/DeleteCounterCmd.java  |    5 ++---
 .../api/command/admin/cluster/AddClusterCmd.java   |    9 ++++-----
 .../command/admin/cluster/DeleteClusterCmd.java    |    8 ++------
 .../api/command/admin/cluster/ListClustersCmd.java |   14 +++++++-------
 .../command/admin/cluster/UpdateClusterCmd.java    |    5 ++---
 5 files changed, 17 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fb9db2b1/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
index 0476278..0cde5cd 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
@@ -22,7 +22,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 DeleteCounterCmd extends BaseAsyncCmd {
     // ////////////// API parameters /////////////////////
     // ///////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName = "counter")
-    @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = 
true, description = "the ID of the counter", entityType=CounterResponse.class)
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, 
entityType=CounterResponse.class,
+            required=true, description="the ID of the counter")
     private Long id;
 
     // ///////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fb9db2b1/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
index 0728d66..77846ee 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
@@ -24,7 +24,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;
@@ -51,8 +50,8 @@ public class AddClusterCmd extends BaseCmd {
     @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, 
required=false, description="the password for the host")
     private String password;
 
-    //@IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, 
description="the Pod ID for the host", entityType=PodResponse.class)
+    @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, 
entityType=PodResponse.class,
+            required=true, description="the Pod ID for the host")
     private Long podId;
 
     @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, 
description="the URL")
@@ -61,8 +60,8 @@ public class AddClusterCmd extends BaseCmd {
     @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, 
required=false, description="the username for the cluster")
     private String username;
 
-    //@IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, 
required=true, description="the Zone ID for the cluster", 
entityType=ZoneResponse.class)
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, 
entityType=ZoneResponse.class,
+            required=true, description="the Zone ID for the cluster")
     private Long zoneId;
 
     @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, 
required=true, description="hypervisor type of the cluster: 
XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fb9db2b1/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
index 1b41360..23a80fa 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
@@ -20,7 +20,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;
@@ -28,7 +27,6 @@ import org.apache.cloudstack.api.response.ClusterResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import com.cloud.user.Account;
 
-
 @Implementation(description="Deletes a cluster.", 
responseObject=SuccessResponse.class)
 public class DeleteClusterCmd extends BaseCmd {
     public static final Logger s_logger = 
Logger.getLogger(DeleteClusterCmd.class.getName());
@@ -39,11 +37,10 @@ public class DeleteClusterCmd extends BaseCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    //@IdentityMapper(entityTableName="cluster")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="the cluster ID", entityType=ClusterResponse.class)
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, 
entityType=ClusterResponse.class,
+            required=true, description="the cluster ID")
     private Long id;
 
-
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -52,7 +49,6 @@ public class DeleteClusterCmd extends BaseCmd {
         return id;
     }
 
-
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fb9db2b1/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
index 1a3934e..4ff55ac 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
@@ -20,11 +20,11 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd;
+import org.apache.cloudstack.api.response.PodResponse;
 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;
@@ -44,19 +44,19 @@ public class ListClustersCmd extends BaseListCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="cluster")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="lists 
clusters by the cluster ID")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, 
entityType=ClusterResponse.class,
+            description="lists clusters by the cluster ID")
     private Long id;
 
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, 
description="lists clusters by the cluster name")
     private String clusterName;
 
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, 
description="lists clusters by Pod ID")
+    @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, 
entityType=PodResponse.class,
+            description="lists clusters by Pod ID")
     private Long podId;
 
-    //@IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, 
description="lists clusters by Zone ID", entityType=ZoneResponse.class)
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, 
entityType=ZoneResponse.class,
+            description="lists clusters by Zone ID")
     private Long zoneId;
 
     @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, 
description="lists clusters by hypervisor type")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/fb9db2b1/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
index 1c98980..fe1800a 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
@@ -20,7 +20,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;
@@ -35,8 +34,8 @@ public class UpdateClusterCmd extends BaseCmd {
 
     private static final String s_name = "updateclusterresponse";
 
-    //@IdentityMapper(entityTableName="cluster")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="the ID of the Cluster", entityType=ClusterResponse.class)
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, 
entityType=ClusterResponse.class,
+            required=true, description="the ID of the Cluster")
     private Long id;
 
     @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, 
description="the cluster name")

Reply via email to