use of com.cloud.server.api.response.netapp.ListVolumesOnFilerCmdResponse 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());
}
}
Aggregations