Search in sources :

Example 1 with GuestOSCategoryResponse

use of com.cloud.api.response.GuestOSCategoryResponse in project CloudStack-archive by CloudStack-extras.

the class ListGuestOsCategoriesCmd method execute.

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

Aggregations

GuestOSCategoryResponse (com.cloud.api.response.GuestOSCategoryResponse)1 ListResponse (com.cloud.api.response.ListResponse)1 GuestOsCategory (com.cloud.storage.GuestOsCategory)1 ArrayList (java.util.ArrayList)1