api: Annotate resource apis

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-22 16:18:50 -08:00
parent 97514a0693
commit 7e3c0ec002
3 changed files with 14 additions and 9 deletions

View File

@ -42,8 +42,8 @@ public class ListAlertsCmd extends BaseListCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName="alert")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "the ID of the alert")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = AlertResponse.class,
description = "the ID of the alert")
private Long id;
@Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "list by alert type")

View File

@ -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.CapacityResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.capacity.Capacity;
import com.cloud.exception.InvalidParameterValueException;
@ -43,16 +45,16 @@ public class ListCapacityCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="data_center")
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="lists capacity by the Zone ID")
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
description="lists capacity by the Zone ID")
private Long zoneId;
@IdentityMapper(entityTableName="host_pod_ref")
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="lists capacity by the Pod ID")
@Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType = PodResponse.class,
description="lists capacity by the Pod ID")
private Long podId;
@IdentityMapper(entityTableName="cluster")
@Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, since="3.0.0", description="lists capacity by the Cluster ID")
@Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType = ClusterResponse.class,
since="3.0.0", description="lists capacity by the Cluster ID")
private Long clusterId;
@Parameter(name=ApiConstants.FETCH_LATEST, type=CommandType.BOOLEAN, since="3.0.0", description="recalculate capacities and fetch the latest")

View File

@ -18,11 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
import com.cloud.alert.Alert;
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=Alert.class)
@SuppressWarnings("unused")
public class AlertResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the id of the alert")