Updated Branches:
  refs/heads/api_refactoring 06246ae27 -> 07f5e1ac2

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

Branch: refs/heads/api_refactoring
Commit: 07f5e1ac2df0664d320dcd4bdd84d29d539c8616
Parents: b37aca4
Author: Rohit Yadav <[email protected]>
Authored: Sun Dec 23 03:26:06 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Sun Dec 23 03:26:06 2012 -0800

----------------------------------------------------------------------
 .../user/offering/ListDiskOfferingsCmd.java        |   10 ++++----
 .../user/offering/ListServiceOfferingsCmd.java     |   16 ++++++++------
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/07f5e1ac/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
index 31b03e8..f08df7a 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
@@ -23,10 +23,10 @@ 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.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.ListResponse;
 import com.cloud.offering.DiskOffering;
 
@@ -40,12 +40,12 @@ public class ListDiskOfferingsCmd extends BaseListCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, 
description="the ID of the domain of the disk offering.")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType 
= DomainResponse.class,
+            description="the ID of the domain of the disk offering.")
     private Long domainId;
 
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of 
the disk offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
DiskOfferingResponse.class,
+            description="ID of the disk offering")
     private Long id;
 
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, 
description="name of the disk offering")

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/07f5e1ac/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
 
b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
index 9dfa82d..6077723 100644
--- 
a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.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.DomainResponse;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.ServiceOfferingResponse;
+import org.apache.cloudstack.api.response.UserVmResponse;
 import com.cloud.offering.ServiceOffering;
 
 @Implementation(description="Lists all available service offerings.", 
responseObject=ServiceOfferingResponse.class)
@@ -40,19 +42,19 @@ public class ListServiceOfferingsCmd extends BaseListCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of 
the service offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = 
DiskOfferingResponse.class,
+            description="ID of the service offering")
     private Long id;
 
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, 
description="name of the service offering")
     private String serviceOfferingName;
 
-    @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, 
description="the ID of the virtual machine. Pass this in if you want to see the 
available service offering that a virtual machine can be changed to.")
+    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, 
entityType = UserVmResponse.class,
+            description="the ID of the virtual machine. Pass this in if you 
want to see the available service offering that a virtual machine can be 
changed to.")
     private Long virtualMachineId;
 
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, 
description="the ID of the domain associated with the service offering")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType 
= DomainResponse.class,
+            description="the ID of the domain associated with the service 
offering")
     private Long domainId;
 
     @Parameter(name=ApiConstants.IS_SYSTEM_OFFERING, type=CommandType.BOOLEAN, 
description="is this a system vm offering")

Reply via email to