use of com.cloudera.thunderhead.service.usermanagement.UserManagementProto.ListWorkloadAdministrationGroupsForMemberResponse in project cloudbreak by hortonworks.
the class GrpcUmsClient method listWorkloadAdministrationGroupsForMember.
/**
* Lists the workload administration groups a member belongs to.
*
* @param memberCrn the CRN of the user or machine user
* @param requestId request id for getting rights
* @return the workload administration groups associated with this user or machine user
*/
public List<String> listWorkloadAdministrationGroupsForMember(String memberCrn, Optional<String> requestId) {
requireNonNull(memberCrn);
List<String> wags = new ArrayList<>();
UmsClient client = makeClient(channelWrapper.getChannel());
LOGGER.debug("Getting workload administration groups for member {}", memberCrn);
ListWorkloadAdministrationGroupsForMemberResponse response;
Optional<PageToken> pageToken = Optional.empty();
do {
response = client.listWorkloadAdministrationGroupsForMember(RequestIdUtil.getOrGenerate(requestId), memberCrn, pageToken);
wags.addAll(response.getWorkloadAdministrationGroupNameList());
pageToken = Optional.ofNullable(response.getNextPageToken());
} while (response.hasNextPageToken());
LOGGER.debug("{} workload administration groups found for member {}", wags.size(), memberCrn);
return wags;
}
use of com.cloudera.thunderhead.service.usermanagement.UserManagementProto.ListWorkloadAdministrationGroupsForMemberResponse in project cloudbreak by hortonworks.
the class GrpcUmsClient method listWorkloadAdministrationGroupsForMember.
/**
* Lists the workload administration groups a member belongs to.
*
* @param memberCrn the CRN of the user or machine user
* @param requestId request id for getting rights
* @return the workload administration groups associated with this user or machine user
*/
public List<String> listWorkloadAdministrationGroupsForMember(String memberCrn, Optional<String> requestId, RegionAwareInternalCrnGeneratorFactory regionAwareInternalCrnGeneratorFactory) {
requireNonNull(memberCrn);
List<String> wags = new ArrayList<>();
UmsClient client = makeClient(channelWrapper.getChannel(), regionAwareInternalCrnGeneratorFactory);
LOGGER.debug("Getting workload administration groups for member {}", memberCrn);
ListWorkloadAdministrationGroupsForMemberResponse response;
Optional<PageToken> pageToken = Optional.empty();
do {
response = client.listWorkloadAdministrationGroupsForMember(RequestIdUtil.getOrGenerate(requestId), memberCrn, pageToken);
wags.addAll(response.getWorkloadAdministrationGroupNameList());
pageToken = Optional.ofNullable(response.getNextPageToken());
} while (response.hasNextPageToken());
LOGGER.debug("{} workload administration groups found for member {}", wags.size(), memberCrn);
return wags;
}
Aggregations