Search in sources :

Example 1 with WorkloadAdministrationGroup

use of com.cloudera.thunderhead.service.usermanagement.UserManagementProto.WorkloadAdministrationGroup in project cloudbreak by hortonworks.

the class UmsClient method listWorkloadAdministrationGroups.

/**
 * Wraps calls to ListWorkloadAdministrationGroups with an Account ID.
 *
 * @param requestId the request ID for the request
 * @param accountId the account ID
 * @return the list of workload administration groups
 */
public List<WorkloadAdministrationGroup> listWorkloadAdministrationGroups(String requestId, String accountId) {
    checkNotNull(requestId, "requestId should not be null.");
    validateAccountIdWithWarning(accountId);
    List<WorkloadAdministrationGroup> wags = new ArrayList<>();
    ListWorkloadAdministrationGroupsRequest.Builder requestBuilder = ListWorkloadAdministrationGroupsRequest.newBuilder().setAccountId(accountId).setPageSize(umsClientConfig.getListWorkloadAdministrationGroupsPageSize());
    ListWorkloadAdministrationGroupsResponse response;
    do {
        response = newStub(requestId).listWorkloadAdministrationGroups(requestBuilder.build());
        wags.addAll(response.getWorkloadAdministrationGroupList());
        requestBuilder.setPageToken(response.getNextPageToken());
    } while (response.hasNextPageToken());
    return wags;
}
Also used : ArrayList(java.util.ArrayList) ListWorkloadAdministrationGroupsRequest(com.cloudera.thunderhead.service.usermanagement.UserManagementProto.ListWorkloadAdministrationGroupsRequest) WorkloadAdministrationGroup(com.cloudera.thunderhead.service.usermanagement.UserManagementProto.WorkloadAdministrationGroup) ListWorkloadAdministrationGroupsResponse(com.cloudera.thunderhead.service.usermanagement.UserManagementProto.ListWorkloadAdministrationGroupsResponse)

Aggregations

ListWorkloadAdministrationGroupsRequest (com.cloudera.thunderhead.service.usermanagement.UserManagementProto.ListWorkloadAdministrationGroupsRequest)1 ListWorkloadAdministrationGroupsResponse (com.cloudera.thunderhead.service.usermanagement.UserManagementProto.ListWorkloadAdministrationGroupsResponse)1 WorkloadAdministrationGroup (com.cloudera.thunderhead.service.usermanagement.UserManagementProto.WorkloadAdministrationGroup)1 ArrayList (java.util.ArrayList)1