:doc:`ElasticBeanstalk <../../elasticbeanstalk>` / Client / describe_events

***************
describe_events
***************



.. py:method:: ElasticBeanstalk.Client.describe_events(**kwargs)

  

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

   

  .. note::

    

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

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/DescribeEvents>`_  


  **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'
    )
    
  :type ApplicationName: string
  :param ApplicationName: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those associated with this application.

    

  
  :type VersionLabel: string
  :param VersionLabel: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this application version.

    

  
  :type TemplateName: string
  :param TemplateName: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to those that are associated with this environment configuration.

    

  
  :type EnvironmentId: string
  :param EnvironmentId: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this environment.

    

  
  :type EnvironmentName: string
  :param EnvironmentName: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this environment.

    

  
  :type PlatformArn: string
  :param PlatformArn: 

    The ARN of a custom platform version. If specified, AWS Elastic Beanstalk restricts the returned descriptions to those associated with this custom platform version.

    

  
  :type RequestId: string
  :param RequestId: 

    If specified, AWS Elastic Beanstalk restricts the described events to include only those associated with this request ID.

    

  
  :type Severity: string
  :param Severity: 

    If specified, limits the events returned from this call to include only those with the specified severity or higher.

    

  
  :type StartTime: datetime
  :param StartTime: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to those that occur on or after this time.

    

  
  :type EndTime: datetime
  :param EndTime: 

    If specified, AWS Elastic Beanstalk restricts the returned descriptions to those that occur up to, but not including, the ``EndTime``.

    

  
  :type MaxRecords: integer
  :param MaxRecords: 

    Specifies the maximum number of events that can be returned, beginning with the most recent event.

    

  
  :type NextToken: string
  :param NextToken: 

    Pagination token. If specified, the events return the next batch of results.

    

  
  
  :rtype: 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': {
            '...': '...',
        },
    }

  