use of com.cloud.server.api.response.netapp.ListLunsCmdResponse in project cloudstack by apache.
the class ListLunsCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
List<LunVO> lunList = netappMgr.listLunsOnFiler(poolName);
ListResponse<ListLunsCmdResponse> listResponse = new ListResponse<ListLunsCmdResponse>();
List<ListLunsCmdResponse> responses = new ArrayList<ListLunsCmdResponse>();
for (LunVO lun : lunList) {
ListLunsCmdResponse response = new ListLunsCmdResponse();
response.setId(lun.getId());
response.setIqn(lun.getTargetIqn());
response.setName(lun.getLunName());
response.setVolumeId(lun.getVolumeId());
response.setObjectName("lun");
responses.add(response);
}
listResponse.setResponses(responses);
listResponse.setResponseName(getCommandName());
this.setResponseObject(listResponse);
} catch (InvalidParameterValueException e) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.toString());
}
}
Aggregations