Search in sources :

Example 6 with SystemVmResponse

use of com.cloud.api.response.SystemVmResponse in project CloudStack-archive by CloudStack-extras.

the class StopSystemVmCmd method execute.

@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
    UserContext.current().setEventDetails("Vm Id: " + getId());
    VirtualMachine result = _mgr.stopSystemVM(this);
    if (result != null) {
        SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Fail to stop system vm");
    }
}
Also used : SystemVmResponse(com.cloud.api.response.SystemVmResponse) ServerApiException(com.cloud.api.ServerApiException) VirtualMachine(com.cloud.vm.VirtualMachine)

Aggregations

SystemVmResponse (com.cloud.api.response.SystemVmResponse)6 VirtualMachine (com.cloud.vm.VirtualMachine)6 ServerApiException (com.cloud.api.ServerApiException)5 ListResponse (com.cloud.api.response.ListResponse)1 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 ServiceOffering (com.cloud.offering.ServiceOffering)1 ArrayList (java.util.ArrayList)1