def dms_status()

in scripts/checkDmsEndpoints.py [0:0]


def dms_status(endpoint, rep_inst):
    try:
        dms_client = boto3.client('dms')
        response = dms_client.describe_connections(
        Filters=[
            {
                'Name': 'endpoint-arn',
                'Values': [endpoint]
            },
            {
                'Name': 'replication-instance-arn',
                'Values': [rep_inst]
            }
            ]
        )
        e = response['Connections'][0]['Status']
    except Exception as e:
        print('Error occured with replication instance: %s and endpoint: %s' %(endpoint,rep_inst))
        print ('Exception is %s' %(e))
    return e