use of org.apache.cloudstack.api.response.UnmanageVMInstanceResponse in project cloudstack by apache.
the class UnmanageVMInstanceCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
UnmanageVMInstanceResponse response = new UnmanageVMInstanceResponse();
try {
CallContext.current().setEventDetails("VM ID = " + vmId);
boolean result = unmanagedVMsManager.unmanageVMInstance(vmId);
response.setSuccess(result);
if (result) {
response.setDetails("VM unmanaged successfully");
}
} catch (Exception e) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
response.setResponseName(getCommandName());
response.setObjectName(getCommandName());
this.setResponseObject(response);
}
Aggregations