:doc:`DatabaseMigrationService <../../dms>` / Client / test_connection

***************
test_connection
***************



.. py:method:: DatabaseMigrationService.Client.test_connection(**kwargs)

  

  Tests the connection between the replication instance and the endpoint.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TestConnection>`_  


  **Request Syntax**
  ::

    response = client.test_connection(
        ReplicationInstanceArn='string',
        EndpointArn='string'
    )
    
  :type ReplicationInstanceArn: string
  :param ReplicationInstanceArn: **[REQUIRED]** 

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

    

  
  :type EndpointArn: string
  :param EndpointArn: **[REQUIRED]** 

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

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Connection': {
              'ReplicationInstanceArn': 'string',
              'EndpointArn': 'string',
              'Status': 'string',
              'LastFailureMessage': 'string',
              'EndpointIdentifier': 'string',
              'ReplicationInstanceIdentifier': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Connection** *(dict) --* 

        The connection tested.

        
        

        - **ReplicationInstanceArn** *(string) --* 

          The ARN of the replication instance.

          
        

        - **EndpointArn** *(string) --* 

          The ARN string that uniquely identifies the endpoint.

          
        

        - **Status** *(string) --* 

          The connection status. This parameter can return one of the following values:

           

          
          * ``"successful"``
           
          * ``"testing"``
           
          * ``"failed"``
           
          * ``"deleting"``
          

          
        

        - **LastFailureMessage** *(string) --* 

          The error message when the connection last failed.

          
        

        - **EndpointIdentifier** *(string) --* 

          The identifier of the endpoint. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen or contain two consecutive hyphens.

          
        

        - **ReplicationInstanceIdentifier** *(string) --* 

          The replication instance identifier. This parameter is stored as a lowercase string.

          
    
  
  **Exceptions**
  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.ResourceNotFoundFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.InvalidResourceStateFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.KMSKeyNotAccessibleFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.ResourceQuotaExceededFault`

  
  *   :py:class:`DatabaseMigrationService.Client.exceptions.AccessDeniedFault`

  

  **Examples**

  Tests the connection between the replication instance and the endpoint.
  ::

    response = client.test_connection(
        EndpointArn='arn:aws:dms:us-east-1:123456789012:endpoint:RAAR3R22XSH46S3PWLC3NJAWKM',
        ReplicationInstanceArn='arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Connection': {
        },
        'ResponseMetadata': {
            '...': '...',
        },
    }

  