Search in sources :

Example 1 with HypervisorResponse

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);
}
Also used : HypervisorResponse(org.apache.cloudstack.api.response.HypervisorResponse) ListResponse(org.apache.cloudstack.api.response.ListResponse) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 HypervisorResponse (org.apache.cloudstack.api.response.HypervisorResponse)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1