describeHostKey method

Future<DescribeHostKeyResponse> describeHostKey({
  1. required String hostKeyId,
  2. required String serverId,
})

Returns the details of the host key that's specified by the HostKeyId and ServerId.

May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter hostKeyId : The identifier of the host key that you want described.

Parameter serverId : The identifier of the server that contains the host key that you want described.

Implementation

Future<DescribeHostKeyResponse> describeHostKey({
  required String hostKeyId,
  required String serverId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.DescribeHostKey'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HostKeyId': hostKeyId,
      'ServerId': serverId,
    },
  );

  return DescribeHostKeyResponse.fromJson(jsonResponse.body);
}