testConnection method

Future<TestConnectionResponse> testConnection({
  1. required String endpointArn,
  2. required String replicationInstanceArn,
})

Tests the connection between the replication instance and the endpoint.

May throw ResourceNotFoundFault. May throw InvalidResourceStateFault. May throw KMSKeyNotAccessibleFault. May throw ResourceQuotaExceededFault.

Parameter endpointArn : The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.

Parameter replicationInstanceArn : The Amazon Resource Name (ARN) of the replication instance.

Implementation

Future<TestConnectionResponse> testConnection({
  required String endpointArn,
  required String replicationInstanceArn,
}) async {
  ArgumentError.checkNotNull(endpointArn, 'endpointArn');
  ArgumentError.checkNotNull(
      replicationInstanceArn, 'replicationInstanceArn');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDMSv20160101.TestConnection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndpointArn': endpointArn,
      'ReplicationInstanceArn': replicationInstanceArn,
    },
  );

  return TestConnectionResponse.fromJson(jsonResponse.body);
}