use of com.cloud.api.response.ExtractResponse in project CloudStack-archive by CloudStack-extras.
the class ExtractTemplateCmd method execute.
@Override
public void execute() {
try {
UserContext.current().setEventDetails(getEventDescription());
Long uploadId = _templateService.extract(this);
if (uploadId != null) {
ExtractResponse response = _responseGenerator.createExtractResponse(uploadId, id, zoneId, getEntityOwnerId(), mode);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to extract template");
}
} catch (InternalErrorException ex) {
s_logger.warn("Exception: ", ex);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
}
}
use of com.cloud.api.response.ExtractResponse in project cosmic by MissionCriticalCloud.
the class ExtractTemplateCmd method execute.
@Override
public void execute() {
try {
CallContext.current().setEventDetails(getEventDescription());
final String uploadUrl = _templateService.extract(this);
if (uploadUrl != null) {
final ExtractResponse response = _responseGenerator.createExtractResponse(id, zoneId, getEntityOwnerId(), mode, uploadUrl);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to extract template");
}
} catch (final InternalErrorException ex) {
s_logger.warn("Exception: ", ex);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
}
}
Aggregations