use of org.apache.cloudstack.api.response.HypervisorResponse in project cloudstack by apache.
the class ListHypervisorsCmd method execute.
@Override
public void execute() {
List<String> result = _mgr.getHypervisors(getZoneId());
ListResponse<HypervisorResponse> response = new ListResponse<HypervisorResponse>();
ArrayList<HypervisorResponse> responses = new ArrayList<HypervisorResponse>();
if (result != null) {
for (String hypervisor : result) {
HypervisorResponse hypervisorResponse = new HypervisorResponse();
hypervisorResponse.setName(hypervisor);
hypervisorResponse.setObjectName("hypervisor");
responses.add(hypervisorResponse);
}
}
response.setResponses(responses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
Aggregations