Search in sources :

Example 1 with ManagementServerResponse

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

the class QueryManagerImpl method listManagementServers.

@Override
public ListResponse<ManagementServerResponse> listManagementServers(ListMgmtsCmd cmd) {
    ListResponse<ManagementServerResponse> response = new ListResponse<>();
    Pair<List<ManagementServerHostVO>, Integer> result = listManagementServersInternal(cmd);
    List<ManagementServerResponse> hostResponses = new ArrayList<>();
    for (ManagementServerHostVO host : result.first()) {
        ManagementServerResponse hostResponse = createManagementServerResponse(host);
        hostResponses.add(hostResponse);
    }
    response.setResponses(hostResponses);
    return response;
}
Also used : ManagementServerHostVO(com.cloud.cluster.ManagementServerHostVO) ManagementServerResponse(org.apache.cloudstack.api.response.ManagementServerResponse) ListResponse(org.apache.cloudstack.api.response.ListResponse) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with ManagementServerResponse

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

the class ApiResponseHelper method createManagementResponse.

public ManagementServerResponse createManagementResponse(ManagementServerHost mgmt) {
    ManagementServerResponse response = new ManagementServerResponse();
    response.setId(mgmt.getUuid());
    response.setName(mgmt.getName());
    response.setVersion(mgmt.getVersion());
    response.setState(mgmt.getState());
    return response;
}
Also used : ManagementServerResponse(org.apache.cloudstack.api.response.ManagementServerResponse)

Example 3 with ManagementServerResponse

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

the class QueryManagerImpl method createManagementServerResponse.

protected ManagementServerResponse createManagementServerResponse(ManagementServerHostVO mgmt) {
    ManagementServerResponse mgmtResponse = new ManagementServerResponse();
    mgmtResponse.setId(mgmt.getUuid());
    mgmtResponse.setName(mgmt.getName());
    mgmtResponse.setState(mgmt.getState());
    mgmtResponse.setVersion(mgmt.getVersion());
    mgmtResponse.setObjectName("managementserver");
    return mgmtResponse;
}
Also used : ManagementServerResponse(org.apache.cloudstack.api.response.ManagementServerResponse)

Aggregations

ManagementServerResponse (org.apache.cloudstack.api.response.ManagementServerResponse)3 ManagementServerHostVO (com.cloud.cluster.ManagementServerHostVO)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1