ElasticBeanstalk / Client / describe_events

describe_events

ElasticBeanstalk.Client.describe_events(**kwargs)

Returns list of event descriptions matching criteria up to the last 6 weeks.

This action returns the most recent 1,000 events from the specified NextToken.

This action only returns information about resources that the calling principle has IAM permissions to access. For example, consider a case where a user only has permission to access one of three resources. When the user calls the this action, the response will only include the one resource that the user has permission to access instead of all three resources. If the user doesn’t have access to any of the resources an empty result is returned.

Note

The AWSElasticBeanstalkReadOnly managed policy allows operators to view information about resources related to Elastic Beanstalk. For more information, see Managing Elastic Beanstalk user policies in the Elastic Beanstalk Developer Guide. For detailed instructions to attach a policy to a user or group, see the section Controlling access with managed policies in the same topic.

See also: AWS API Documentation

Request Syntax

response = client.describe_events(
    ApplicationName='string',
    VersionLabel='string',
    TemplateName='string',
    EnvironmentId='string',
    EnvironmentName='string',
    PlatformArn='string',
    RequestId='string',
    Severity='TRACE'|'DEBUG'|'INFO'|'WARN'|'ERROR'|'FATAL',
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    MaxRecords=123,
    NextToken='string'
)
Parameters:
  • ApplicationName (string) – If specified, Elastic Beanstalk restricts the returned descriptions to include only those associated with this application.

  • VersionLabel (string) – If specified, Elastic Beanstalk restricts the returned descriptions to those associated with this application version.

  • TemplateName (string) – If specified, Elastic Beanstalk restricts the returned descriptions to those that are associated with this environment configuration.

  • EnvironmentId (string) – If specified, Elastic Beanstalk restricts the returned descriptions to those associated with this environment.

  • EnvironmentName (string) – If specified, Elastic Beanstalk restricts the returned descriptions to those associated with this environment.

  • PlatformArn (string) – The ARN of a custom platform version. If specified, Elastic Beanstalk restricts the returned descriptions to those associated with this custom platform version.

  • RequestId (string) – If specified, Elastic Beanstalk restricts the described events to include only those associated with this request ID.

  • Severity (string) – If specified, limits the events returned from this call to include only those with the specified severity or higher.

  • StartTime (datetime) – If specified, Elastic Beanstalk restricts the returned descriptions to those that occur on or after this time.

  • EndTime (datetime) – If specified, Elastic Beanstalk restricts the returned descriptions to those that occur up to, but not including, the EndTime.

  • MaxRecords (integer) – Specifies the maximum number of events that can be returned, beginning with the most recent event.

  • NextToken (string) – Pagination token. If specified, the events return the next batch of results.

Return type:

dict

Returns:

Response Syntax

{
    'Events': [
        {
            'EventDate': datetime(2015, 1, 1),
            'Message': 'string',
            'ApplicationName': 'string',
            'VersionLabel': 'string',
            'TemplateName': 'string',
            'EnvironmentName': 'string',
            'PlatformArn': 'string',
            'RequestId': 'string',
            'Severity': 'TRACE'|'DEBUG'|'INFO'|'WARN'|'ERROR'|'FATAL'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    Result message wrapping a list of event descriptions.

    • Events (list) –

      A list of EventDescription.

      • (dict) –

        Describes an event.

        • EventDate (datetime) –

          The date when the event occurred.

        • Message (string) –

          The event message.

        • ApplicationName (string) –

          The application associated with the event.

        • VersionLabel (string) –

          The release label for the application version associated with this event.

        • TemplateName (string) –

          The name of the configuration associated with this event.

        • EnvironmentName (string) –

          The name of the environment associated with this event.

        • PlatformArn (string) –

          The ARN of the platform version.

        • RequestId (string) –

          The web service request ID for the activity of this event.

        • Severity (string) –

          The severity level of this event.

    • NextToken (string) –

      If returned, this indicates that there are more results to obtain. Use this token in the next DescribeEvents call to get the next batch of events.

Examples

The following operation retrieves events for an environment named my-env:

response = client.describe_events(
    EnvironmentName='my-env',
)

print(response)

Expected Output:

{
    'Events': [
        {
            'ApplicationName': 'my-app',
            'EnvironmentName': 'my-env',
            'EventDate': datetime(2015, 8, 20, 7, 6, 53, 3, 232, 0),
            'Message': 'Environment health has transitioned from Info to Ok.',
            'Severity': 'INFO',
        },
        {
            'ApplicationName': 'my-app',
            'EnvironmentName': 'my-env',
            'EventDate': datetime(2015, 8, 20, 7, 6, 2, 3, 232, 0),
            'Message': 'Environment update completed successfully.',
            'RequestId': 'b7f3960b-4709-11e5-ba1e-07e16200da41',
            'Severity': 'INFO',
        },
        {
            'ApplicationName': 'my-app',
            'EnvironmentName': 'my-env',
            'EventDate': datetime(2015, 8, 13, 19, 16, 27, 3, 225, 0),
            'Message': 'Using elasticbeanstalk-us-west-2-012445113685 as Amazon S3 storage bucket for environment data.',
            'RequestId': 'ca8dfbf6-41ef-11e5-988b-651aa638f46b',
            'Severity': 'INFO',
        },
        {
            'ApplicationName': 'my-app',
            'EnvironmentName': 'my-env',
            'EventDate': datetime(2015, 8, 13, 19, 16, 26, 3, 225, 0),
            'Message': 'createEnvironment is starting.',
            'RequestId': 'cdfba8f6-41ef-11e5-988b-65638f41aa6b',
            'Severity': 'INFO',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}