listPodIdentityAssociations method

Future<ListPodIdentityAssociationsResponse> listPodIdentityAssociations({
  1. required String clusterName,
  2. int? maxResults,
  3. String? namespace,
  4. String? nextToken,
  5. String? serviceAccount,
})

List the EKS Pod Identity associations in a cluster. You can filter the list by the namespace that the association is in or the service account that the association uses.

May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServerException.

Parameter clusterName : The name of the cluster that the associations are in.

Parameter maxResults : The maximum number of EKS Pod Identity association results returned by ListPodIdentityAssociations in paginated output. When you use this parameter, ListPodIdentityAssociations returns only maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListPodIdentityAssociations request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListPodIdentityAssociations returns up to 100 results and a nextToken value if applicable.

Parameter namespace : The name of the Kubernetes namespace inside the cluster that the associations are in.

Parameter nextToken : The nextToken value returned from a previous paginated ListUpdates request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

Parameter serviceAccount : The name of the Kubernetes service account that the associations use.

Implementation

Future<ListPodIdentityAssociationsResponse> listPodIdentityAssociations({
  required String clusterName,
  int? maxResults,
  String? namespace,
  String? nextToken,
  String? serviceAccount,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (namespace != null) 'namespace': [namespace],
    if (nextToken != null) 'nextToken': [nextToken],
    if (serviceAccount != null) 'serviceAccount': [serviceAccount],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/clusters/${Uri.encodeComponent(clusterName)}/pod-identity-associations',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListPodIdentityAssociationsResponse.fromJson(response);
}