You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/24 02:46:01 UTC
[3/8] git commit: api: Annotate usage related apis
api: Annotate usage related apis
Signed-off-by: Rohit Yadav <bh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/a4fed07a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/a4fed07a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/a4fed07a
Branch: refs/heads/api_refactoring
Commit: a4fed07a7e6c63d7bf6d526f890274d638977467
Parents: fd784bd
Author: Rohit Yadav <bh...@apache.org>
Authored: Sun Dec 23 17:33:30 2012 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Sun Dec 23 17:33:30 2012 -0800
----------------------------------------------------------------------
.../cloud/api/commands/AddTrafficMonitorCmd.java | 7 ++---
.../api/commands/DeleteTrafficMonitorCmd.java | 6 ++--
.../api/commands/GenerateUsageRecordsCmd.java | 6 ++--
.../com/cloud/api/commands/GetUsageRecordsCmd.java | 16 ++++++++------
.../cloud/api/commands/ListTrafficMonitorsCmd.java | 7 ++---
5 files changed, 21 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4fed07a/server/src/com/cloud/api/commands/AddTrafficMonitorCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/AddTrafficMonitorCmd.java b/server/src/com/cloud/api/commands/AddTrafficMonitorCmd.java
index 063b28b..1aba395 100644
--- a/server/src/com/cloud/api/commands/AddTrafficMonitorCmd.java
+++ b/server/src/com/cloud/api/commands/AddTrafficMonitorCmd.java
@@ -16,11 +16,11 @@
// under the License.
package com.cloud.api.commands;
+import org.apache.cloudstack.api.response.ZoneResponse;
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;
@@ -43,10 +43,9 @@ public class AddTrafficMonitorCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required = true, description="Zone in which to add the external firewall appliance.")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
+ required = true, description="Zone in which to add the external firewall appliance.")
private Long zoneId;
-
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required = true, description="URL of the traffic monitor Host")
private String url;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4fed07a/server/src/com/cloud/api/commands/DeleteTrafficMonitorCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/DeleteTrafficMonitorCmd.java b/server/src/com/cloud/api/commands/DeleteTrafficMonitorCmd.java
index 6e03cca..265de33 100644
--- a/server/src/com/cloud/api/commands/DeleteTrafficMonitorCmd.java
+++ b/server/src/com/cloud/api/commands/DeleteTrafficMonitorCmd.java
@@ -16,11 +16,11 @@
// under the License.
package com.cloud.api.commands;
+import org.apache.cloudstack.api.response.HostResponse;
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;
@@ -40,8 +40,8 @@ public class DeleteTrafficMonitorCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="host")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required = true, description="Id of the Traffic Monitor Host.")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = HostResponse.class,
+ required = true, description="Id of the Traffic Monitor Host.")
private Long id;
///////////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4fed07a/server/src/com/cloud/api/commands/GenerateUsageRecordsCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/GenerateUsageRecordsCmd.java b/server/src/com/cloud/api/commands/GenerateUsageRecordsCmd.java
index 15e0430..5bb2766 100644
--- a/server/src/com/cloud/api/commands/GenerateUsageRecordsCmd.java
+++ b/server/src/com/cloud/api/commands/GenerateUsageRecordsCmd.java
@@ -18,11 +18,11 @@ package com.cloud.api.commands;
import java.util.Date;
+import org.apache.cloudstack.api.response.DomainResponse;
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;
@@ -40,8 +40,8 @@ public class GenerateUsageRecordsCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="List events for the specified domain.")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
+ description="List events for the specified domain.")
private Long domainId;
@Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, required=true, description="End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.")
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4fed07a/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java b/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
index 77fdd56..8699302 100644
--- a/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
+++ b/server/src/com/cloud/api/commands/GetUsageRecordsCmd.java
@@ -23,6 +23,9 @@ import java.util.Date;
import java.util.List;
import java.util.TimeZone;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@@ -31,7 +34,6 @@ import com.cloud.dc.DataCenter;
import com.cloud.domain.Domain;
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;
@@ -59,8 +61,8 @@ public class GetUsageRecordsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="List usage records for the specified user.")
private String accountName;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="List usage records for the specified domain.")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
+ description="List usage records for the specified domain.")
private Long domainId;
@Parameter(name=ApiConstants.END_DATE, type=CommandType.DATE, required=true, description="End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.")
@@ -69,12 +71,12 @@ public class GetUsageRecordsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.START_DATE, type=CommandType.DATE, required=true, description="Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.")
private Date startDate;
- @IdentityMapper(entityTableName="account")
- @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.LONG, description="List usage records for the specified account")
+ @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType = AccountResponse.class,
+ description="List usage records for the specified account")
private Long accountId;
- @IdentityMapper(entityTableName="projects")
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="List usage records for specified project")
+ @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
+ description="List usage records for specified project")
private Long projectId;
@Parameter(name=ApiConstants.TYPE, type=CommandType.LONG, description="List usage records for the specified usage type")
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a4fed07a/server/src/com/cloud/api/commands/ListTrafficMonitorsCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/ListTrafficMonitorsCmd.java b/server/src/com/cloud/api/commands/ListTrafficMonitorsCmd.java
index 4db5f9f..07e45fb 100644
--- a/server/src/com/cloud/api/commands/ListTrafficMonitorsCmd.java
+++ b/server/src/com/cloud/api/commands/ListTrafficMonitorsCmd.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.ZoneResponse;
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;
@@ -44,11 +44,10 @@ public class ListTrafficMonitorsCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required = true, description="zone Id")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
+ required = true, description="zone Id")
private long zoneId;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////