use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class UpdateProjectInvitationCmd method execute.
@Override
public void execute() {
CallContext.current().setEventDetails("Project id: " + projectId + "; accountName " + accountName + "; accept " + getAccept());
final boolean result = _projectService.updateInvitation(projectId, accountName, token, getAccept());
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to join the project");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteSnapshotCmd method execute.
@Override
public void execute() {
CallContext.current().setEventDetails("Snapshot Id: " + getId());
final boolean result = _snapshotService.deleteSnapshot(getId());
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete snapshot");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteSSHKeyPairCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final boolean result = _mgr.deleteSSHKeyPair(this);
final SuccessResponse response = new SuccessResponse(getCommandName());
response.setSuccess(result);
setResponseObject(response);
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class CreateTagsCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final List<ResourceTag> tags = _taggedResourceService.createTags(getResourceIds(), getResourceType(), getTags(), getCustomer());
if (tags != null && !tags.isEmpty()) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create tags");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteTagsCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final boolean success = _taggedResourceService.deleteTags(getResourceIds(), getResourceType(), getTags());
if (success) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete tags");
}
}
Aggregations