Search in sources :

Example 1 with GuestOSCategoryResponse

use of org.apache.cloudstack.api.response.GuestOSCategoryResponse in project cloudstack by apache.

the class ListGuestOsCategoriesCmd method execute.

@Override
public void execute() {
    Pair<List<? extends GuestOsCategory>, Integer> result = _mgr.listGuestOSCategoriesByCriteria(this);
    ListResponse<GuestOSCategoryResponse> response = new ListResponse<GuestOSCategoryResponse>();
    List<GuestOSCategoryResponse> osCatResponses = new ArrayList<GuestOSCategoryResponse>();
    for (GuestOsCategory osCategory : result.first()) {
        GuestOSCategoryResponse categoryResponse = new GuestOSCategoryResponse();
        categoryResponse.setId(osCategory.getUuid());
        categoryResponse.setName(osCategory.getName());
        categoryResponse.setObjectName("oscategory");
        osCatResponses.add(categoryResponse);
    }
    response.setResponses(osCatResponses, result.second());
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : GuestOSCategoryResponse(org.apache.cloudstack.api.response.GuestOSCategoryResponse) ListResponse(org.apache.cloudstack.api.response.ListResponse) GuestOsCategory(com.cloud.storage.GuestOsCategory) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

GuestOsCategory (com.cloud.storage.GuestOsCategory)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 GuestOSCategoryResponse (org.apache.cloudstack.api.response.GuestOSCategoryResponse)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1