Search in sources :

Example 6 with ProjectResponse

use of org.apache.cloudstack.api.response.ProjectResponse in project cloudstack by apache.

the class SuspendProjectCmd method execute.

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
    CallContext.current().setEventDetails("Project Id: " + id);
    Project project = _projectService.suspendProject(id);
    if (project != null) {
        ProjectResponse response = _responseGenerator.createProjectResponse(project);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to suspend a project");
    }
}
Also used : Project(com.cloud.projects.Project) ProjectResponse(org.apache.cloudstack.api.response.ProjectResponse) ServerApiException(org.apache.cloudstack.api.ServerApiException)

Aggregations

ProjectResponse (org.apache.cloudstack.api.response.ProjectResponse)6 Project (com.cloud.projects.Project)4 ServerApiException (org.apache.cloudstack.api.ServerApiException)4 AccountJoinVO (com.cloud.api.query.vo.AccountJoinVO)1 ProjectJoinVO (com.cloud.api.query.vo.ProjectJoinVO)1 ResourceTagJoinVO (com.cloud.api.query.vo.ResourceTagJoinVO)1 Account (com.cloud.user.Account)1 ArrayList (java.util.ArrayList)1 Hashtable (java.util.Hashtable)1