mirror of https://github.com/apache/cloudstack.git
api: Annotate resource apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
4d79909828
commit
a0a8a0bb5d
|
|
@ -22,11 +22,11 @@ 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;
|
||||
import org.apache.cloudstack.api.response.CloudIdentifierResponse;
|
||||
import org.apache.cloudstack.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Retrieves a cloud identifier.", responseObject=CloudIdentifierResponse.class)
|
||||
|
|
@ -38,11 +38,10 @@ public class GetCloudIdentifierCmd extends BaseCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="user")
|
||||
@Parameter(name=ApiConstants.USER_ID, type=CommandType.LONG, required=true, description="the user ID for the cloud identifier")
|
||||
@Parameter(name=ApiConstants.USER_ID, type=CommandType.UUID, entityType = UserResponse.class,
|
||||
required=true, description="the user ID for the cloud identifier")
|
||||
private Long userid;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -51,7 +50,6 @@ public class GetCloudIdentifierCmd extends BaseCmd {
|
|||
return userid;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ 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.response.HypervisorResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description = "List hypervisors", responseObject = HypervisorResponse.class)
|
||||
|
|
@ -45,8 +45,8 @@ public class ListHypervisorsCmd extends BaseCmd {
|
|||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.LONG, description = "the zone id for listing hypervisors.")
|
||||
@Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class,
|
||||
description = "the zone id for listing hypervisors.")
|
||||
private Long zoneId;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@ 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;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceCountResponse;
|
||||
import com.cloud.configuration.ResourceCount;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
|
||||
@Implementation(description="Recalculate and update resource count for an account or domain.", responseObject=ResourceCountResponse.class)
|
||||
public class UpdateResourceCountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateResourceCountCmd.class.getName());
|
||||
|
|
@ -48,8 +48,8 @@ public class UpdateResourceCountCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Update resource count for a specified account. Must be used with the domainId parameter.")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="If account parameter specified then updates resource counts for a specified account in this domain else update resource counts for all accounts & child domains in specified domain.")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
|
||||
required=true, description="If account parameter specified then updates resource counts for a specified account in this domain else update resource counts for all accounts & child domains in specified domain.")
|
||||
private Long domainId;
|
||||
|
||||
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.INTEGER, description= "Type of resource to update. If specifies valid values are 0, 1, 2, 3, and 4. If not specified will update all resource counts" +
|
||||
|
|
@ -60,8 +60,8 @@ public class UpdateResourceCountCmd extends BaseCmd {
|
|||
"4 - Template. Number of templates that a user can register/create.")
|
||||
private Integer resourceType;
|
||||
|
||||
@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Update resource limits for project")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
|
||||
description="Update resource limits for project")
|
||||
private Long projectId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -20,10 +20,11 @@ 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;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceLimitResponse;
|
||||
import com.cloud.configuration.ResourceLimit;
|
||||
import com.cloud.user.UserContext;
|
||||
|
|
@ -34,7 +35,6 @@ public class UpdateResourceLimitCmd extends BaseCmd {
|
|||
|
||||
private static final String s_name = "updateresourcelimitresponse";
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -42,12 +42,12 @@ public class UpdateResourceLimitCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Update resource for a specified account. Must be used with the domainId parameter.")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
|
||||
description="Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.")
|
||||
private Long domainId;
|
||||
|
||||
@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Update resource limits for project")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
|
||||
description="Update resource limits for project")
|
||||
private Long projectId;
|
||||
|
||||
@Parameter(name=ApiConstants.MAX, type=CommandType.LONG, description=" Maximum resource limit.")
|
||||
|
|
|
|||
Loading…
Reference in New Issue