use of org.apache.cloudstack.api.response.TemplateResponse in project cloudstack by apache.
the class UpdateTemplateCmdByAdmin method execute.
@Override
public void execute() {
VirtualMachineTemplate result = _templateService.updateTemplate(this);
if (result != null) {
TemplateResponse response = _responseGenerator.createTemplateUpdateResponse(ResponseView.Full, result);
response.setObjectName("template");
//Template can be either USER or ROUTING type
response.setTemplateType(result.getTemplateType().toString());
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update template");
}
}
Aggregations