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