use of com.cloud.server.api.response.netapp.ListVolumePoolsCmdResponse in project cloudstack by apache.
the class ListVolumePoolsCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
List<PoolVO> poolList = netappMgr.listPools();
ListResponse<ListVolumePoolsCmdResponse> listResponse = new ListResponse<ListVolumePoolsCmdResponse>();
List<ListVolumePoolsCmdResponse> responses = new ArrayList<ListVolumePoolsCmdResponse>();
for (PoolVO pool : poolList) {
ListVolumePoolsCmdResponse response = new ListVolumePoolsCmdResponse();
response.setId(pool.getId());
response.setName(pool.getName());
response.setAlgorithm(pool.getAlgorithm());
response.setObjectName("pool");
responses.add(response);
}
listResponse.setResponses(responses);
listResponse.setResponseName(getCommandName());
this.setResponseObject(listResponse);
} catch (InvalidParameterValueException e) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
}
}
Aggregations