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

Branch: refs/heads/api_refactoring
Commit: 02efffa93efabc5a639613af144d28a25239130f
Parents: 1931667
Author: Rohit Yadav <[email protected]>
Authored: Sun Dec 23 17:24:58 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Sun Dec 23 17:24:58 2012 -0800

----------------------------------------------------------------------
 .../api/command/user/vpc/DeleteStaticRouteCmd.java |   11 ++++++-----
 .../api/command/user/vpc/DeleteVPCCmd.java         |    9 +++------
 .../command/user/vpc/ListPrivateGatewaysCmd.java   |    2 +-
 3 files changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/02efffa9/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java 
b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
index f3f4825..b8c2437 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
@@ -16,12 +16,13 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.StaticRouteResponse;
 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,13 +43,13 @@ public class DeleteStaticRouteCmd extends BaseAsyncCmd{
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="static_routes")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="the ID of the static route")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
StaticRouteResponse.class,
+            required=true, description="the ID of the static route")
     private Long id;
 
     // unexposed parameter needed for events logging
-    @IdentityMapper(entityTableName="account")
-    @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.LONG, 
expose=false)
+    @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType 
= AccountResponse.class,
+            expose=false)
     private Long ownerId;
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/02efffa9/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java 
b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
index 7165db7..4c02903 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
@@ -16,12 +16,12 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpc;
 
+import org.apache.cloudstack.api.response.VpcResponse;
 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;
@@ -32,7 +32,6 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.vpc.Vpc;
 import com.cloud.user.Account;
 
-
 @Implementation(description="Deletes a VPC", 
responseObject=SuccessResponse.class)
 public class DeleteVPCCmd extends BaseAsyncCmd{
     public static final Logger s_logger = 
Logger.getLogger(DeleteVPCCmd.class.getName());
@@ -42,11 +41,10 @@ public class DeleteVPCCmd extends BaseAsyncCmd{
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="vpc")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="the ID of the VPC")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
VpcResponse.class,
+            required=true, description="the ID of the VPC")
     private Long id;
 
-
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -55,7 +53,6 @@ public class DeleteVPCCmd extends BaseAsyncCmd{
         return id;
     }
 
-
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/02efffa9/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
index 12062c8..b71c067 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
@@ -40,7 +40,7 @@ public class ListPrivateGatewaysCmd extends 
BaseListProjectAndAccountResourcesCm
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
-    @Parameter(name=ApiConstants.ID, type=CommandType.UUID,  
entityType=PrivateGatewayResponse.class,
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, 
entityType=PrivateGatewayResponse.class,
             description="list private gateway by id")
     private Long id;
 

Reply via email to