From 27482045ceef4ee4e8165c21f97c24200888beed Mon Sep 17 00:00:00 2001 From: Fang Wang Date: Fri, 14 Dec 2012 11:31:05 -0800 Subject: [PATCH] API refactoring -- More parameter for counter group. --- .../api/command/admin/autoscale/DeleteCounterCmd.java | 3 ++- .../org/apache/cloudstack/api/response/CounterResponse.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java index 1e7f70a4f9e..0476278f7d0 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java @@ -26,6 +26,7 @@ import org.apache.cloudstack.api.IdentityMapper; import org.apache.cloudstack.api.Implementation; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.CounterResponse; import org.apache.cloudstack.api.response.SuccessResponse; import com.cloud.async.AsyncJob; import com.cloud.event.EventTypes; @@ -42,7 +43,7 @@ public class DeleteCounterCmd extends BaseAsyncCmd { // /////////////////////////////////////////////////// @IdentityMapper(entityTableName = "counter") - @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the counter") + @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the counter", entityType=CounterResponse.class) private Long id; // /////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/response/CounterResponse.java b/api/src/org/apache/cloudstack/api/response/CounterResponse.java index 5260f1e8f55..f3cf3b33614 100644 --- a/api/src/org/apache/cloudstack/api/response/CounterResponse.java +++ b/api/src/org/apache/cloudstack/api/response/CounterResponse.java @@ -18,12 +18,16 @@ package org.apache.cloudstack.api.response; import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.Entity; + +import com.cloud.network.as.Counter; import com.cloud.serializer.Param; import com.cloud.utils.IdentityProxy; import com.google.gson.annotations.SerializedName; import org.apache.cloudstack.api.BaseResponse; @SuppressWarnings("unused") +@Entity(value=Counter.class) public class CounterResponse extends BaseResponse { @SerializedName("id") @Param(description = "the id of the Counter")