Search in sources :

Example 1 with CreateVolumeOnFilerCmdResponse

use of com.cloud.server.api.response.netapp.CreateVolumeOnFilerCmdResponse in project cloudstack by apache.

the class CreateVolumeOnFilerCmd method execute.

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
    //param checks
    if (snapshotReservation != null && (snapshotReservation < 0 || snapshotReservation > 100))
        throw new InvalidParameterValueException("Invalid snapshot reservation");
    StringBuilder s = new StringBuilder(getVolSize().toString());
    s.append("g");
    try {
        netappMgr.createVolumeOnFiler(ipAddress, aggrName, poolName, volName, s.toString(), snapshotPolicy, snapshotReservation, userName, password);
        CreateVolumeOnFilerCmdResponse response = new CreateVolumeOnFilerCmdResponse();
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } catch (ServerException e) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString());
    } catch (InvalidParameterValueException e) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
    } catch (UnknownHostException e) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
    }
}
Also used : ServerException(java.rmi.ServerException) ServerApiException(org.apache.cloudstack.api.ServerApiException) UnknownHostException(java.net.UnknownHostException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) CreateVolumeOnFilerCmdResponse(com.cloud.server.api.response.netapp.CreateVolumeOnFilerCmdResponse)

Aggregations

InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 CreateVolumeOnFilerCmdResponse (com.cloud.server.api.response.netapp.CreateVolumeOnFilerCmdResponse)1 UnknownHostException (java.net.UnknownHostException)1 ServerException (java.rmi.ServerException)1 ServerApiException (org.apache.cloudstack.api.ServerApiException)1