deleteHsm method
Deletes the specified HSM. To specify an HSM, you can use its identifier (ID), the IP address of the HSM's elastic network interface (ENI), or the ID of the HSM's ENI. You need to specify only one of these values. To find these values, use DescribeClusters.
Cross-account use: No. You cannot perform this operation on an CloudHSM hsm 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 contains the HSM that you are
deleting.
Parameter eniId :
The identifier (ID) of the elastic network interface (ENI) of the HSM that
you are deleting.
Parameter eniIp :
The IP address of the elastic network interface (ENI) of the HSM that you
are deleting.
Parameter hsmId :
The identifier (ID) of the HSM that you are deleting.
Implementation
Future<DeleteHsmResponse> deleteHsm({
required String clusterId,
String? eniId,
String? eniIp,
String? hsmId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'BaldrApiService.DeleteHsm'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ClusterId': clusterId,
if (eniId != null) 'EniId': eniId,
if (eniIp != null) 'EniIp': eniIp,
if (hsmId != null) 'HsmId': hsmId,
},
);
return DeleteHsmResponse.fromJson(jsonResponse.body);
}