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.
Parameters:
-
cluster_id
(ClusterId)
–
The identifier (ID) of the cluster that contains the HSM that you are deleting.
-
hsm_id
(Optional[HsmId], default:
None
)
–
The identifier (ID) of the HSM that you are deleting.
-
eni_id
(Optional[EniId], default:
None
)
–
The identifier (ID) of the elastic network interface (ENI) of the HSM that you are deleting.
-
eni_ip
(Optional[IpAddress], default:
None
)
–
The IP address of the elastic network interface (ENI) of the HSM that you are deleting.
Raises:
Source code in docs_src/capo_cloudhsm_v2/_services/cloud_hsmv2.py
| def delete_hsm(
self,
cluster_id: "capo_cloudhsm_v2.types.cluster_id.ClusterId",
*,
config_overrides: Optional[CloudHSMV2ClientConfig] = None,
hsm_id: Optional["capo_cloudhsm_v2.types.hsm_id.HsmId"] = None,
eni_id: Optional["capo_cloudhsm_v2.types.eni_id.EniId"] = None,
eni_ip: Optional["capo_cloudhsm_v2.types.ip_address.IpAddress"] = None,
) -> "capo_cloudhsm_v2.types.delete_hsm_response.DeleteHsmResponse":
"""<p>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 <a>DescribeClusters</a>.</p> <p> <b>Cross-account use:</b> No. You cannot perform this operation on an CloudHSM hsm in a different Amazon Web Services account.</p>
Args:
cluster_id: <p>The identifier (ID) of the cluster that contains the HSM that you are deleting.</p>
hsm_id: <p>The identifier (ID) of the HSM that you are deleting.</p>
eni_id: <p>The identifier (ID) of the elastic network interface (ENI) of the HSM that you are deleting.</p>
eni_ip: <p>The IP address of the elastic network interface (ENI) of the HSM that you are deleting.</p>
Raises:
capo_cloudhsm_v2.errors.cloud_hsm_access_denied_exception.CloudHsmAccessDeniedException: <p>The request was rejected because the requester does not have permission to perform the requested operation.</p>
capo_cloudhsm_v2.errors.cloud_hsm_internal_failure_exception.CloudHsmInternalFailureException: <p>The request was rejected because of an CloudHSM internal failure. The request can be retried.</p>
capo_cloudhsm_v2.errors.cloud_hsm_invalid_request_exception.CloudHsmInvalidRequestException: <p>The request was rejected because it is not a valid request.</p>
capo_cloudhsm_v2.errors.cloud_hsm_resource_not_found_exception.CloudHsmResourceNotFoundException: <p>The request was rejected because it refers to a resource that cannot be found.</p>
capo_cloudhsm_v2.errors.cloud_hsm_service_exception.CloudHsmServiceException: <p>The request was rejected because an error occurred.</p>
capo_cloudhsm_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudhsm_v2.types.delete_hsm_request.DeleteHsmRequest]",
) -> OperationResponse[
"capo_cloudhsm_v2.types.delete_hsm_response.DeleteHsmResponse"
]:
import capo_cloudhsm_v2._operations.baldr_api_service.delete_hsm
output, http_response = (
capo_cloudhsm_v2._operations.baldr_api_service.delete_hsm.delete_hsm(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteHsm")
)
input_: capo_cloudhsm_v2.types.delete_hsm_request.DeleteHsmRequest = {
"cluster_id": cluster_id
}
if hsm_id is not None:
input_["hsm_id"] = hsm_id
if eni_id is not None:
input_["eni_id"] = eni_id
if eni_ip is not None:
input_["eni_ip"] = eni_ip
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|