Search in sources :

Example 1 with NetappVolumeVO

use of com.cloud.netapp.NetappVolumeVO in project cloudstack by apache.

the class VolumeDaoImpl method listVolumesAscending.

@Override
public List<NetappVolumeVO> listVolumesAscending(String poolName) {
    Filter searchFilter = new Filter(NetappVolumeVO.class, "id", Boolean.TRUE, Long.valueOf(0), Long.valueOf(10000));
    SearchCriteria<NetappVolumeVO> sc = NetappListVolumeSearch.create();
    sc.setParameters("poolName", poolName);
    return listBy(sc, searchFilter);
}
Also used : NetappVolumeVO(com.cloud.netapp.NetappVolumeVO) Filter(com.cloud.utils.db.Filter)

Example 2 with NetappVolumeVO

use of com.cloud.netapp.NetappVolumeVO in project cloudstack by apache.

the class ListVolumesOnFilerCmd method execute.

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
    try {
        List<NetappVolumeVO> volumes = netappMgr.listVolumesOnFiler(poolName);
        ListResponse<ListVolumesOnFilerCmdResponse> listResponse = new ListResponse<ListVolumesOnFilerCmdResponse>();
        List<ListVolumesOnFilerCmdResponse> responses = new ArrayList<ListVolumesOnFilerCmdResponse>();
        for (NetappVolumeVO volume : volumes) {
            ListVolumesOnFilerCmdResponse response = new ListVolumesOnFilerCmdResponse();
            response.setId(volume.getId());
            response.setIpAddress(volume.getIpAddress());
            response.setPoolName(volume.getPoolName());
            response.setAggrName(volume.getAggregateName());
            response.setVolumeName(volume.getVolumeName());
            response.setSnapshotPolicy(volume.getSnapshotPolicy());
            response.setSnapshotReservation(volume.getSnapshotReservation());
            response.setVolumeSize(volume.getVolumeSize());
            response.setObjectName("volume");
            responses.add(response);
        }
        listResponse.setResponses(responses);
        listResponse.setResponseName(getCommandName());
        this.setResponseObject(listResponse);
    } catch (InvalidParameterValueException e) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.toString());
    }
}
Also used : NetappVolumeVO(com.cloud.netapp.NetappVolumeVO) ListVolumesOnFilerCmdResponse(com.cloud.server.api.response.netapp.ListVolumesOnFilerCmdResponse) ListResponse(org.apache.cloudstack.api.response.ListResponse) ServerApiException(org.apache.cloudstack.api.ServerApiException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) ArrayList(java.util.ArrayList)

Aggregations

NetappVolumeVO (com.cloud.netapp.NetappVolumeVO)2 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 ListVolumesOnFilerCmdResponse (com.cloud.server.api.response.netapp.ListVolumesOnFilerCmdResponse)1 Filter (com.cloud.utils.db.Filter)1 ArrayList (java.util.ArrayList)1 ServerApiException (org.apache.cloudstack.api.ServerApiException)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1