modifyCluster method

Future<ModifyClusterResponse> modifyCluster({
  1. required String clusterId,
  2. BackupRetentionPolicy? backupRetentionPolicy,
  3. String? hsmType,
})

Modifies CloudHSM cluster.

Cross-account use: No. You cannot perform this operation on an CloudHSM cluster in a different Amazon Web Services account.

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

Parameter clusterId : The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use DescribeClusters.

Parameter backupRetentionPolicy : A policy that defines how the service retains backups.

Parameter hsmType : The desired HSM type of the cluster.

Implementation

Future<ModifyClusterResponse> modifyCluster({
  required String clusterId,
  BackupRetentionPolicy? backupRetentionPolicy,
  String? hsmType,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'BaldrApiService.ModifyCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterId': clusterId,
      if (backupRetentionPolicy != null)
        'BackupRetentionPolicy': backupRetentionPolicy,
      if (hsmType != null) 'HsmType': hsmType,
    },
  );

  return ModifyClusterResponse.fromJson(jsonResponse.body);
}