api: Annotate autoscale and cluster apis

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-18 13:59:11 -08:00
parent 6116f3a433
commit fb9db2b1b1
5 changed files with 17 additions and 24 deletions

View File

@ -22,7 +22,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;
@ -42,8 +41,8 @@ public class DeleteCounterCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "counter")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the counter", entityType=CounterResponse.class)
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=CounterResponse.class,
required=true, description="the ID of the counter")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -24,7 +24,6 @@ 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;
@ -51,8 +50,8 @@ public class AddClusterCmd extends BaseCmd {
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
private String password;
//@IdentityMapper(entityTableName="host_pod_ref")
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host", entityType=PodResponse.class)
@Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class,
required=true, description="the Pod ID for the host")
private Long podId;
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
@ -61,8 +60,8 @@ public class AddClusterCmd extends BaseCmd {
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
private String username;
//@IdentityMapper(entityTableName="data_center")
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster", entityType=ZoneResponse.class)
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
required=true, description="the Zone ID for the cluster")
private Long zoneId;
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")

View File

@ -20,7 +20,6 @@ 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;
@ -28,7 +27,6 @@ import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.user.Account;
@Implementation(description="Deletes a cluster.", responseObject=SuccessResponse.class)
public class DeleteClusterCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(DeleteClusterCmd.class.getName());
@ -39,11 +37,10 @@ public class DeleteClusterCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
//@IdentityMapper(entityTableName="cluster")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the cluster ID", entityType=ClusterResponse.class)
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ClusterResponse.class,
required=true, description="the cluster ID")
private Long id;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -52,7 +49,6 @@ public class DeleteClusterCmd extends BaseCmd {
return id;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

View File

@ -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.PodResponse;
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.ClusterResponse;
@ -44,19 +44,19 @@ public class ListClustersCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="cluster")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="lists clusters by the cluster ID")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ClusterResponse.class,
description="lists clusters by the cluster ID")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="lists clusters by the cluster name")
private String clusterName;
@IdentityMapper(entityTableName="host_pod_ref")
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="lists clusters by Pod ID")
@Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class,
description="lists clusters by Pod ID")
private Long podId;
//@IdentityMapper(entityTableName="data_center")
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="lists clusters by Zone ID", entityType=ZoneResponse.class)
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
description="lists clusters by Zone ID")
private Long zoneId;
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="lists clusters by hypervisor type")

View File

@ -20,7 +20,6 @@ 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;
@ -35,8 +34,8 @@ public class UpdateClusterCmd extends BaseCmd {
private static final String s_name = "updateclusterresponse";
//@IdentityMapper(entityTableName="cluster")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Cluster", entityType=ClusterResponse.class)
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ClusterResponse.class,
required=true, description="the ID of the Cluster")
private Long id;
@Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name")