describeHsm method

Future<DescribeHsmResponse> describeHsm({
  1. String? hsmArn,
  2. String? hsmSerialNumber,
})

This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.

For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.

Retrieves information about an HSM. You can identify the HSM by its ARN or its serial number.

May throw CloudHsmServiceException. May throw CloudHsmInternalException. May throw InvalidRequestException.

Parameter hsmArn : The ARN of the HSM. Either the HsmArn or the SerialNumber parameter must be specified.

Parameter hsmSerialNumber : The serial number of the HSM. Either the HsmArn or the HsmSerialNumber parameter must be specified.

Implementation

Future<DescribeHsmResponse> describeHsm({
  String? hsmArn,
  String? hsmSerialNumber,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CloudHsmFrontendService.DescribeHsm'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (hsmArn != null) 'HsmArn': hsmArn,
      if (hsmSerialNumber != null) 'HsmSerialNumber': hsmSerialNumber,
    },
  );

  return DescribeHsmResponse.fromJson(jsonResponse.body);
}