Updated Branches:
  refs/heads/api_refactoring e9457cb40 -> 4e2b30d31

api: Annotate vpc admin 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/4e2b30d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/4e2b30d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/4e2b30d3

Branch: refs/heads/api_refactoring
Commit: 4e2b30d31dc944800ec37db6113b5b9b98d38941
Parents: 6f3c7bf
Author: Rohit Yadav <[email protected]>
Authored: Sat Dec 22 19:09:18 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Sat Dec 22 19:09:18 2012 -0800

----------------------------------------------------------------------
 .../command/admin/vpc/CreatePrivateGatewayCmd.java |   11 ++++++-----
 .../command/admin/vpc/DeletePrivateGatewayCmd.java |    6 +++---
 .../command/admin/vpc/DeleteVPCOfferingCmd.java    |    8 +++-----
 .../command/admin/vpc/UpdateVPCOfferingCmd.java    |    5 ++---
 .../api/response/PrivateGatewayResponse.java       |    3 +++
 5 files changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4e2b30d3/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
index 800a54c..3126e6d 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
@@ -16,13 +16,14 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+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.BaseAsyncCreateCmd;
 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;
@@ -48,8 +49,8 @@ public class CreatePrivateGatewayCmd extends 
BaseAsyncCreateCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="physical_network")
-    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, 
description="the Physical Network ID the network belongs to")
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, 
entityType = PhysicalNetworkResponse.class,
+            description="the Physical Network ID the network belongs to")
     private Long physicalNetworkId;
 
     @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, 
required=true, description="the gateway of the Private gateway")
@@ -64,8 +65,8 @@ public class CreatePrivateGatewayCmd extends 
BaseAsyncCreateCmd {
     @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, required=true, 
description="the Vlan for the private gateway")
     private String vlan;
 
-    @IdentityMapper(entityTableName="vpc")
-    @Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, required=true, 
description="the VPC network belongs to")
+    @Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType = 
VpcResponse.class,
+            required=true, description="the VPC network belongs to")
     private Long vpcId;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4e2b30d3/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
index 01576e8..53b6ba1 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
@@ -16,12 +16,12 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
+import org.apache.cloudstack.api.response.PrivateGatewayResponse;
 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;
@@ -44,8 +44,8 @@ public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="vpc_gateways")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="the ID of the private gateway")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
PrivateGatewayResponse.class,
+            required=true, description="the ID of the private gateway")
     private Long id;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4e2b30d3/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
index 6d81f2e..71f4148 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
@@ -16,12 +16,12 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.vpc;
 
+import org.apache.cloudstack.api.response.VpcOfferingResponse;
 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;
@@ -38,11 +38,10 @@ public class DeleteVPCOfferingCmd extends BaseAsyncCmd{
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="vpc_offerings")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="the ID of the VPC offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
VpcOfferingResponse.class,
+            required=true, description="the ID of the VPC offering")
     private Long id;
 
-
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -51,7 +50,6 @@ public class DeleteVPCOfferingCmd extends BaseAsyncCmd{
         return id;
     }
 
-
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4e2b30d3/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
index 0fa03ca..c2fcbc8 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.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;
@@ -39,8 +38,8 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="vpc_offerings")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the 
id of the VPC offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
VpcOfferingResponse.class,
+            description="the id of the VPC offering")
     private Long id;
 
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, 
description="the name of the VPC offering")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4e2b30d3/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java 
b/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
index 143a61a..0bbc66a 100644
--- a/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
@@ -15,11 +15,14 @@
 // specific language governing permissions and limitations
 // under the License.
 package org.apache.cloudstack.api.response;
+import com.cloud.network.vpc.VpcGateway;
 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=VpcGateway.class)
 @SuppressWarnings("unused")
 public class PrivateGatewayResponse extends BaseResponse implements 
ControlledEntityResponse{
 

Reply via email to