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);
}
Aggregations