Search in sources :

Example 1 with AssociateLunCmdResponse

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

the class AssociateLunCmd method execute.

@Override
public void execute() {
    try {
        AssociateLunCmdResponse response = new AssociateLunCmdResponse();
        String[] returnVals = null;
        returnVals = netappMgr.associateLun(getGuestIQN(), getLunName());
        response.setLun(returnVals[0]);
        response.setIpAddress(returnVals[2]);
        response.setTargetIQN(returnVals[1]);
        response.setObjectName("lun");
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } catch (ServerException e) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
    } catch (InvalidParameterValueException e) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString());
    }
}
Also used : ServerException(java.rmi.ServerException) ServerApiException(org.apache.cloudstack.api.ServerApiException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) AssociateLunCmdResponse(com.cloud.server.api.response.netapp.AssociateLunCmdResponse)

Aggregations

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