get_contact_methods

Lightsail.Client.get_contact_methods(**kwargs)

Returns information about the configured contact methods. Specify a protocol in your request to return information about a specific contact method.

A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see Notifications in Amazon Lightsail.

See also: AWS API Documentation

Request Syntax

response = client.get_contact_methods(
    protocols=[
        'Email'|'SMS',
    ]
)
Parameters
protocols (list) --

The protocols used to send notifications, such as Email , or SMS (text messaging).

Specify a protocol in your request to return information about a specific contact method protocol.

  • (string) --
Return type
dict
Returns
Response Syntax
{
    'contactMethods': [
        {
            'contactEndpoint': 'string',
            'status': 'PendingVerification'|'Valid'|'Invalid',
            'protocol': 'Email'|'SMS',
            'name': 'string',
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'location': {
                'availabilityZone': 'string',
                'regionName': 'us-east-1'|'us-east-2'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'eu-central-1'|'ca-central-1'|'ap-south-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'ap-northeast-2'|'eu-north-1'
            },
            'resourceType': 'ContainerService'|'Instance'|'StaticIp'|'KeyPair'|'InstanceSnapshot'|'Domain'|'PeeredVpc'|'LoadBalancer'|'LoadBalancerTlsCertificate'|'Disk'|'DiskSnapshot'|'RelationalDatabase'|'RelationalDatabaseSnapshot'|'ExportSnapshotRecord'|'CloudFormationStackRecord'|'Alarm'|'ContactMethod'|'Distribution'|'Certificate'|'Bucket',
            'supportCode': 'string'
        },
    ]
}

Response Structure

  • (dict) --
    • contactMethods (list) --

      An array of objects that describe the contact methods.

      • (dict) --

        Describes a contact method.

        A contact method is a way to send you notifications. For more information, see Notifications in Amazon Lightsail.

        • contactEndpoint (string) --

          The destination of the contact method, such as an email address or a mobile phone number.

        • status (string) --

          The current status of the contact method.

          A contact method has the following possible status:

          • PendingVerification - The contact method has not yet been verified, and the verification has not yet expired.
          • Valid - The contact method has been verified.
          • InValid - An attempt was made to verify the contact method, but the verification has expired.
        • protocol (string) --

          The protocol of the contact method, such as email or SMS (text messaging).

        • name (string) --

          The name of the contact method.

        • arn (string) --

          The Amazon Resource Name (ARN) of the contact method.

        • createdAt (datetime) --

          The timestamp when the contact method was created.

        • location (dict) --

          An object that describes the location of the contact method, such as the Amazon Web Services Region and Availability Zone.

          • availabilityZone (string) --

            The Availability Zone. Follows the format us-east-2a (case-sensitive).

          • regionName (string) --

            The Amazon Web Services Region name.

        • resourceType (string) --

          The Lightsail resource type (e.g., ContactMethod ).

        • supportCode (string) --

          The support code. Include this code in your email to support when you have questions about your Lightsail contact method. This code enables our support team to look up your Lightsail information more easily.

Exceptions

  • Lightsail.Client.exceptions.ServiceException
  • Lightsail.Client.exceptions.InvalidInputException
  • Lightsail.Client.exceptions.NotFoundException
  • Lightsail.Client.exceptions.OperationFailureException
  • Lightsail.Client.exceptions.AccessDeniedException
  • Lightsail.Client.exceptions.UnauthenticatedException