describeClusters method

Future<DescribeClustersResponse> describeClusters({
  1. Map<String, List<String>>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Gets information about AWS CloudHSM clusters.

This is a paginated operation, which means that each response might contain only a subset of all the clusters. When the response contains only a subset of clusters, it includes a NextToken value. Use this value in a subsequent DescribeClusters request to get more clusters. When you receive a response with no NextToken (or an empty or null value), that means there are no more clusters to get.

May throw CloudHsmAccessDeniedException. May throw CloudHsmInternalFailureException. May throw CloudHsmInvalidRequestException. May throw CloudHsmServiceException. May throw CloudHsmTagException.

Parameter filters : One or more filters to limit the items returned in the response.

Use the clusterIds filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).

Use the vpcIds filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).

Use the states filter to return only clusters that match the specified state.

Parameter maxResults : The maximum number of clusters to return in the response. When there are more clusters than the number you specify, the response contains a NextToken value.

Parameter nextToken : The NextToken value that you received in the previous response. Use this value to get more clusters.

Implementation

Future<DescribeClustersResponse> describeClusters({
  Map<String, List<String>>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    25,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'BaldrApiService.DescribeClusters'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeClustersResponse.fromJson(jsonResponse.body);
}