api: Annotate project API cmd and response

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-18 18:07:37 -08:00
parent 32ca9e2aa4
commit 3e292869eb
10 changed files with 28 additions and 28 deletions

View File

@ -41,8 +41,8 @@ public class ActivateProjectCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ProjectResponse.class,
required=true, description="id of the project to be modified")
private Long id;
/////////////////////////////////////////////////////

View File

@ -21,10 +21,10 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
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 com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
@ -46,8 +46,8 @@ public class CreateProjectCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "account who will be Admin for the project")
private String accountName;
@IdentityMapper(entityTableName = "domain")
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "domain ID of the account owning a project")
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class,
description = "domain ID of the account owning a project")
private Long domainId;
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "name of the project")

View File

@ -16,6 +16,7 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
@ -41,8 +42,8 @@ public class DeleteProjectCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be deleted")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ProjectResponse.class,
required=true, description="id of the project to be deleted")
private Long id;
/////////////////////////////////////////////////////

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
import org.apache.cloudstack.api.response.ProjectInvitationResponse;
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;
@ -38,8 +38,8 @@ public class DeleteProjectInvitationCmd extends BaseAsyncCmd {
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "project_invitations")
@Parameter(name = ApiConstants.ID, required = true, type = CommandType.LONG, description = "id of the invitation")
@Parameter(name = ApiConstants.ID, type=CommandType.UUID, entityType=ProjectInvitationResponse.class,
required = true, description = "id of the invitation")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -16,11 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
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;
@ -34,8 +34,8 @@ public class ListProjectInvitationsCmd extends BaseListAccountResourcesCmd {
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "projects")
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.LONG, description = "list by project id")
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class,
description = "list by project id")
private Long projectId;
@Parameter(name = ApiConstants.ACTIVE_ONLY, type = CommandType.BOOLEAN, description = "if true, list only active invitations - having Pending state and ones that are not timed out yet")
@ -44,8 +44,8 @@ public class ListProjectInvitationsCmd extends BaseListAccountResourcesCmd {
@Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "list invitations by state")
private String state;
@IdentityMapper(entityTableName = "project_invitations")
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "list invitations by id")
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType=ProjectInvitationResponse.class,
description = "list invitations by id")
private Long id;
// ///////////////////////////////////////////////////

View File

@ -25,7 +25,6 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
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;
@ -42,8 +41,8 @@ public class ListProjectsCmd extends BaseListAccountResourcesCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list projects by project ID")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ProjectResponse.class,
description="list projects by project ID")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list projects by name")

View File

@ -21,7 +21,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;
@ -43,8 +42,8 @@ public class SuspendProjectCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be suspended")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ProjectResponse.class,
required=true, description="id of the project to be suspended")
private Long id;
/////////////////////////////////////////////////////

View File

@ -21,7 +21,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 UpdateProjectCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ProjectResponse.class,
required=true, description="id of the project to be modified")
private Long id;
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="new Admin account for the project")

View File

@ -16,12 +16,12 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
import org.apache.cloudstack.api.response.ProjectResponse;
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;
@ -38,8 +38,8 @@ public class UpdateProjectInvitationCmd extends BaseAsyncCmd {
// ///////////////////////////////////////////////////
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
@IdentityMapper(entityTableName = "projects")
@Parameter(name = ApiConstants.PROJECT_ID, required = true, type = CommandType.LONG, description = "id of the project to join")
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class,
required = true, description = "id of the project to join")
private Long projectId;
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "account that is joining the project")

View File

@ -16,12 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
import com.cloud.projects.ProjectInvitation;
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.utils.IdentityProxy;
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=ProjectInvitation.class)
@SuppressWarnings("unused")
public class ProjectInvitationResponse extends BaseResponse implements ControlledViewEntityResponse{
@SerializedName(ApiConstants.ID) @Param(description="the id of the invitation")