use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListVolumesCmd method execute.
@Override
public void execute() {
List<? extends Volume> volumes = _storageService.searchForVolumes(this);
ListResponse<VolumeResponse> response = new ListResponse<VolumeResponse>();
List<VolumeResponse> volResponses = new ArrayList<VolumeResponse>();
for (Volume volume : volumes) {
VolumeResponse volResponse = _responseGenerator.createVolumeResponse(volume);
volResponse.setObjectName("volume");
volResponses.add(volResponse);
}
response.setResponses(volResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListZonesByCmd method execute.
@Override
public void execute() {
List<? extends DataCenter> dataCenters = _mgr.listDataCenters(this);
ListResponse<ZoneResponse> response = new ListResponse<ZoneResponse>();
List<ZoneResponse> zoneResponses = new ArrayList<ZoneResponse>();
for (DataCenter dataCenter : dataCenters) {
ZoneResponse zoneResponse = _responseGenerator.createZoneResponse(dataCenter, showCapacities);
zoneResponse.setObjectName("zone");
zoneResponses.add(zoneResponse);
}
response.setResponses(zoneResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListStoragePoolsCmd method execute.
@Override
public void execute() {
List<? extends StoragePool> pools = _mgr.searchForStoragePools(this);
ListResponse<StoragePoolResponse> response = new ListResponse<StoragePoolResponse>();
List<StoragePoolResponse> poolResponses = new ArrayList<StoragePoolResponse>();
for (StoragePool pool : pools) {
StoragePoolResponse poolResponse = _responseGenerator.createStoragePoolResponse(pool);
poolResponse.setObjectName("storagepool");
poolResponses.add(poolResponse);
}
response.setResponses(poolResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListSystemVMsCmd method execute.
@Override
public void execute() {
List<? extends VirtualMachine> systemVMs = _mgr.searchForSystemVm(this);
ListResponse<SystemVmResponse> response = new ListResponse<SystemVmResponse>();
List<SystemVmResponse> vmResponses = new ArrayList<SystemVmResponse>();
for (VirtualMachine systemVM : systemVMs) {
SystemVmResponse vmResponse = _responseGenerator.createSystemVmResponse(systemVM);
vmResponse.setObjectName("systemvm");
vmResponses.add(vmResponse);
}
response.setResponses(vmResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.ListResponse in project CloudStack-archive by CloudStack-extras.
the class ListTrafficTypeImplementorsCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
List<Pair<TrafficType, String>> results = _networkService.listTrafficTypeImplementor(this);
ListResponse<TrafficTypeImplementorResponse> response = new ListResponse<TrafficTypeImplementorResponse>();
List<TrafficTypeImplementorResponse> responses = new ArrayList<TrafficTypeImplementorResponse>();
for (Pair<TrafficType, String> r : results) {
TrafficTypeImplementorResponse p = new TrafficTypeImplementorResponse();
p.setTrafficType(r.first().toString());
p.setImplementor(r.second());
p.setObjectName("traffictypeimplementorresponse");
responses.add(p);
}
response.setResponses(responses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
Aggregations