SSMContacts / Client / list_contacts

list_contacts#

SSMContacts.Client.list_contacts(**kwargs)#

Lists all contacts and escalation plans in Incident Manager.

See also: AWS API Documentation

Request Syntax

response = client.list_contacts(
    NextToken='string',
    MaxResults=123,
    AliasPrefix='string',
    Type='PERSONAL'|'ESCALATION'|'ONCALL_SCHEDULE'
)
Parameters:
  • NextToken (string) – The pagination token to continue to the next page of results.

  • MaxResults (integer) – The maximum number of contacts and escalation plans per page of results.

  • AliasPrefix (string) – Used to list only contacts who’s aliases start with the specified prefix.

  • Type (string) – The type of contact. A contact is type PERSONAL and an escalation plan is type ESCALATION.

Return type:

dict

Returns:

Response Syntax

{
    'NextToken': 'string',
    'Contacts': [
        {
            'ContactArn': 'string',
            'Alias': 'string',
            'DisplayName': 'string',
            'Type': 'PERSONAL'|'ESCALATION'|'ONCALL_SCHEDULE'
        },
    ]
}

Response Structure

  • (dict) –

    • NextToken (string) –

      The pagination token to continue to the next page of results.

    • Contacts (list) –

      A list of the contacts and escalation plans in your Incident Manager account.

      • (dict) –

        A personal contact or escalation plan that Incident Manager engages during an incident.

        • ContactArn (string) –

          The Amazon Resource Name (ARN) of the contact or escalation plan.

        • Alias (string) –

          The unique and identifiable alias of the contact or escalation plan.

        • DisplayName (string) –

          The full name of the contact or escalation plan.

        • Type (string) –

          Refers to the type of contact. A single contact is type PERSONAL and an escalation plan is type ESCALATION.

Exceptions

  • SSMContacts.Client.exceptions.AccessDeniedException

  • SSMContacts.Client.exceptions.InternalServerException

  • SSMContacts.Client.exceptions.ThrottlingException

  • SSMContacts.Client.exceptions.ValidationException

Examples

The following list-contacts example lists the contacts and escalation plans in your account.

response = client.list_contacts(
)

print(response)

Expected Output:

{
    'Contacts': [
        {
            'Alias': 'akuam',
            'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam',
            'DisplayName': 'Akua Mansa',
            'Type': 'PERSONAL',
        },
        {
            'Alias': 'alejr',
            'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/alejr',
            'DisplayName': 'Alejandro Rosalez',
            'Type': 'PERSONAL',
        },
        {
            'Alias': 'anasi',
            'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/anasi',
            'DisplayName': 'Ana Carolina Silva',
            'Type': 'PERSONAL',
        },
        {
            'Alias': 'example_escalation',
            'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation',
            'DisplayName': 'Example Escalation',
            'Type': 'ESCALATION',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}