Search in sources :

Example 11 with ProjectResponse

use of com.cloud.api.response.ProjectResponse in project cosmic by MissionCriticalCloud.

the class ActivateProjectCmd method execute.

// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
    CallContext.current().setEventDetails("Project id: " + getId());
    final Project project = _projectService.activateProject(getId());
    if (project != null) {
        final ProjectResponse response = _responseGenerator.createProjectResponse(project);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to activate a project");
    }
}
Also used : Project(com.cloud.projects.Project) ProjectResponse(com.cloud.api.response.ProjectResponse) ServerApiException(com.cloud.api.ServerApiException)

Aggregations

ProjectResponse (com.cloud.api.response.ProjectResponse)11 Project (com.cloud.projects.Project)9 ServerApiException (com.cloud.api.ServerApiException)8 ArrayList (java.util.ArrayList)2 AccountJoinVO (com.cloud.api.query.vo.AccountJoinVO)1 ProjectJoinVO (com.cloud.api.query.vo.ProjectJoinVO)1 ResourceTagJoinVO (com.cloud.api.query.vo.ResourceTagJoinVO)1 ListResponse (com.cloud.api.response.ListResponse)1 Account (com.cloud.legacymodel.user.Account)1 Hashtable (java.util.Hashtable)1