Search in sources :

Example 6 with GuestOSHypervisor

use of com.cloud.storage.GuestOSHypervisor in project cloudstack by apache.

the class ListGuestOsMappingCmd method execute.

@Override
public void execute() {
    Pair<List<? extends GuestOSHypervisor>, Integer> result = _mgr.listGuestOSMappingByCriteria(this);
    ListResponse<GuestOsMappingResponse> response = new ListResponse<GuestOsMappingResponse>();
    List<GuestOsMappingResponse> osMappingResponses = new ArrayList<GuestOsMappingResponse>();
    for (GuestOSHypervisor guestOSHypervisor : result.first()) {
        GuestOsMappingResponse guestOsMappingResponse = _responseGenerator.createGuestOSMappingResponse(guestOSHypervisor);
        osMappingResponses.add(guestOsMappingResponse);
    }
    response.setResponses(osMappingResponses, result.second());
    response.setResponseName(getCommandName());
    setResponseObject(response);
}
Also used : GuestOSHypervisor(com.cloud.storage.GuestOSHypervisor) ListResponse(org.apache.cloudstack.api.response.ListResponse) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) GuestOsMappingResponse(org.apache.cloudstack.api.response.GuestOsMappingResponse)

Aggregations

GuestOSHypervisor (com.cloud.storage.GuestOSHypervisor)6 ServerApiException (org.apache.cloudstack.api.ServerApiException)3 GuestOsMappingResponse (org.apache.cloudstack.api.response.GuestOsMappingResponse)3 ActionEvent (com.cloud.event.ActionEvent)2 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)2 DB (com.cloud.utils.db.DB)2 GuestOSHypervisorVO (com.cloud.storage.GuestOSHypervisorVO)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1