deleteCluster method

Future<DeleteClusterResponse> deleteCluster({
  1. required String clusterId,
})

Deletes the specified AWS CloudHSM cluster. Before you can delete a cluster, you must delete all HSMs in the cluster. To see if the cluster contains any HSMs, use DescribeClusters. To delete an HSM, use DeleteHsm.

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

Parameter clusterId : The identifier (ID) of the cluster that you are deleting. To find the cluster ID, use DescribeClusters.

Implementation

Future<DeleteClusterResponse> deleteCluster({
  required String clusterId,
}) async {
  ArgumentError.checkNotNull(clusterId, 'clusterId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'BaldrApiService.DeleteCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterId': clusterId,
    },
  );

  return DeleteClusterResponse.fromJson(jsonResponse.body);
}