Search in sources :

Example 6 with VolumeResponse

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

the class UploadVolumeCmd method execute.

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
    Volume volume = _storageService.uploadVolume(this);
    if (volume != null) {
        VolumeResponse response = _responseGenerator.createVolumeResponse(volume);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to upload volume");
    }
}
Also used : VolumeResponse(com.cloud.api.response.VolumeResponse) ServerApiException(com.cloud.api.ServerApiException) Volume(com.cloud.storage.Volume)

Aggregations

VolumeResponse (com.cloud.api.response.VolumeResponse)6 Volume (com.cloud.storage.Volume)6 ServerApiException (com.cloud.api.ServerApiException)5 ListResponse (com.cloud.api.response.ListResponse)1 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)1 ArrayList (java.util.ArrayList)1