api: Annotate admin apis related to traffic type for usage

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

Branch: refs/heads/api_refactoring
Commit: f3f0962df20b58b25fc253df5017ad2dea41a62d
Parents: 9a3deaf
Author: Rohit Yadav <[email protected]>
Authored: Sat Dec 22 17:19:56 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Sat Dec 22 17:19:56 2012 -0800

----------------------------------------------------------------------
 .../api/command/admin/usage/AddTrafficTypeCmd.java |    6 +++---
 .../command/admin/usage/DeleteTrafficTypeCmd.java  |    6 +++---
 .../command/admin/usage/ListTrafficTypesCmd.java   |    7 +++----
 .../command/admin/usage/UpdateTrafficTypeCmd.java  |    5 ++---
 .../api/response/TrafficTypeResponse.java          |    3 +++
 5 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f3f0962d/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java 
b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
index 25786e0..1cd62f5 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
@@ -16,12 +16,12 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiConstants;
 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;
@@ -43,8 +43,8 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="physical_network")
-    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, 
required=true, description="the Physical Network ID")
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, 
entityType = PhysicalNetworkResponse.class,
+            required=true, description="the Physical Network ID")
     private Long physicalNetworkId;
 
     @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, 
required=true, description="the trafficType to be added to the physical 
network")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f3f0962d/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
index 0f99429..3c00185 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
@@ -16,12 +16,12 @@
 // under the License.
 package org.apache.cloudstack.api.command.admin.usage;
 
+import org.apache.cloudstack.api.response.TrafficTypeResponse;
 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 +39,8 @@ public class DeleteTrafficTypeCmd extends BaseAsyncCmd {
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
-    @IdentityMapper(entityTableName="physical_network_traffic_types")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="traffic type id")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
TrafficTypeResponse.class,
+            required=true, description="traffic type id")
     private Long id;
 
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f3f0962d/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
index e97d1e1..f82829e 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
@@ -19,11 +19,11 @@ package org.apache.cloudstack.api.command.admin.usage;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
 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.ListResponse;
@@ -33,7 +33,6 @@ import com.cloud.network.PhysicalNetworkTrafficType;
 import com.cloud.user.Account;
 import com.cloud.utils.Pair;
 
-
 @Implementation(description="Lists traffic types of a given physical 
network.", responseObject=ProviderResponse.class, since="3.0.0")
 public class ListTrafficTypesCmd extends BaseListCmd {
     public static final Logger s_logger = 
Logger.getLogger(ListTrafficTypesCmd.class.getName());
@@ -42,8 +41,8 @@ public class ListTrafficTypesCmd extends BaseListCmd {
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
-    @IdentityMapper(entityTableName="physical_network")
-    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, 
required=true, description="the Physical Network ID")
+    @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, 
entityType = PhysicalNetworkResponse.class,
+            required=true, description="the Physical Network ID")
     private Long physicalNetworkId;
 
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f3f0962d/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
 
b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
index 389ed09..8f8d333 100644
--- 
a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.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;
@@ -41,8 +40,8 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="physical_network_traffic_types")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, 
description="traffic type id")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
TrafficTypeResponse.class,
+            required=true, description="traffic type id")
     private Long id;
 
     @Parameter(name=ApiConstants.XEN_NETWORK_LABEL, type=CommandType.STRING, 
description="The network name label of the physical device dedicated to this 
traffic on a XenServer host")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/f3f0962d/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java 
b/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
index 6f88d9c..846bcf6 100644
--- a/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
@@ -16,11 +16,14 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
+import com.cloud.network.PhysicalNetworkTrafficType;
 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=PhysicalNetworkTrafficType.class)
 public class TrafficTypeResponse extends BaseResponse {
 
     @SerializedName(ApiConstants.ID) @Param(description="id of the network 
provider")

Reply via email to