:doc:`CloudWatchLogs <../../logs>` / Client / list_scheduled_queries

**********************
list_scheduled_queries
**********************



.. py:method:: CloudWatchLogs.Client.list_scheduled_queries(**kwargs)

  

  Lists all scheduled queries in your account and region. You can filter results by state to show only enabled or disabled queries.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListScheduledQueries>`_  


  **Request Syntax**
  ::

    response = client.list_scheduled_queries(
        maxResults=123,
        nextToken='string',
        state='ENABLED'|'DISABLED'
    )
    
  :type maxResults: integer
  :param maxResults: 

    The maximum number of scheduled queries to return. Valid range is 1 to 1000.

    

  
  :type nextToken: string
  :param nextToken: 

    The token for the next set of items to return. The token expires after 24 hours.

    

  
  :type state: string
  :param state: 

    Filter scheduled queries by state. Valid values are ``ENABLED`` and ``DISABLED``. If not specified, all scheduled queries are returned.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'nextToken': 'string',
          'scheduledQueries': [
              {
                  'scheduledQueryArn': 'string',
                  'name': 'string',
                  'state': 'ENABLED'|'DISABLED',
                  'lastTriggeredTime': 123,
                  'lastExecutionStatus': 'Running'|'InvalidQuery'|'Complete'|'Failed'|'Timeout',
                  'scheduleExpression': 'string',
                  'timezone': 'string',
                  'destinationConfiguration': {
                      's3Configuration': {
                          'destinationIdentifier': 'string',
                          'roleArn': 'string'
                      }
                  },
                  'creationTime': 123,
                  'lastUpdatedTime': 123
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **nextToken** *(string) --* 

        The token for the next set of items to return. The token expires after 24 hours.

        
      

      - **scheduledQueries** *(list) --* 

        An array of scheduled query summary information.

        
        

        - *(dict) --* 

          Summary information about a scheduled query, including basic configuration and execution status.

          
          

          - **scheduledQueryArn** *(string) --* 

            The ARN of the scheduled query.

            
          

          - **name** *(string) --* 

            The name of the scheduled query.

            
          

          - **state** *(string) --* 

            The current state of the scheduled query.

            
          

          - **lastTriggeredTime** *(integer) --* 

            The timestamp when the scheduled query was last executed.

            
          

          - **lastExecutionStatus** *(string) --* 

            The status of the most recent execution.

            
          

          - **scheduleExpression** *(string) --* 

            The cron expression that defines when the scheduled query runs.

            
          

          - **timezone** *(string) --* 

            The timezone used for evaluating the schedule expression.

            
          

          - **destinationConfiguration** *(dict) --* 

            Configuration for where query results are delivered.

            
            

            - **s3Configuration** *(dict) --* 

              Configuration for delivering query results to Amazon S3.

              
              

              - **destinationIdentifier** *(string) --* 

                The Amazon S3 URI where query results are delivered. Must be a valid S3 URI format.

                
              

              - **roleArn** *(string) --* 

                The ARN of the IAM role that grants permissions to write query results to the specified Amazon S3 destination.

                
          
        
          

          - **creationTime** *(integer) --* 

            The timestamp when the scheduled query was created.

            
          

          - **lastUpdatedTime** *(integer) --* 

            The timestamp when the scheduled query was last updated.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ValidationException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ThrottlingException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.InternalServerException`

  