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

**********************
update_scheduled_query
**********************



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

  

  Updates an existing scheduled query with new configuration. This operation uses PUT semantics, allowing modification of query parameters, schedule, and destinations.

  

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


  **Request Syntax**
  ::

    response = client.update_scheduled_query(
        identifier='string',
        description='string',
        queryLanguage='CWLI'|'SQL'|'PPL',
        queryString='string',
        logGroupIdentifiers=[
            'string',
        ],
        scheduleExpression='string',
        timezone='string',
        startTimeOffset=123,
        destinationConfiguration={
            's3Configuration': {
                'destinationIdentifier': 'string',
                'roleArn': 'string'
            }
        },
        scheduleStartTime=123,
        scheduleEndTime=123,
        executionRoleArn='string',
        state='ENABLED'|'DISABLED'
    )
    
  :type identifier: string
  :param identifier: **[REQUIRED]** 

    The ARN or name of the scheduled query to update.

    

  
  :type description: string
  :param description: 

    An updated description for the scheduled query.

    

  
  :type queryLanguage: string
  :param queryLanguage: **[REQUIRED]** 

    The updated query language for the scheduled query.

    

  
  :type queryString: string
  :param queryString: **[REQUIRED]** 

    The updated query string to execute.

    

  
  :type logGroupIdentifiers: list
  :param logGroupIdentifiers: 

    The updated array of log group names or ARNs to query.

    

  
    - *(string) --* 

    

  :type scheduleExpression: string
  :param scheduleExpression: **[REQUIRED]** 

    The updated cron expression that defines when the scheduled query runs.

    

  
  :type timezone: string
  :param timezone: 

    The updated timezone for evaluating the schedule expression.

    

  
  :type startTimeOffset: integer
  :param startTimeOffset: 

    The updated time offset in seconds that defines the lookback period for the query.

    

  
  :type destinationConfiguration: dict
  :param destinationConfiguration: 

    The updated configuration for where to deliver query results.

    

  
    - **s3Configuration** *(dict) --* **[REQUIRED]** 

      Configuration for delivering query results to Amazon S3.

      

    
      - **destinationIdentifier** *(string) --* **[REQUIRED]** 

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

        

      
      - **roleArn** *(string) --* **[REQUIRED]** 

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

        

      
    
  
  :type scheduleStartTime: integer
  :param scheduleStartTime: 

    The updated start time for the scheduled query in Unix epoch format.

    

  
  :type scheduleEndTime: integer
  :param scheduleEndTime: 

    The updated end time for the scheduled query in Unix epoch format.

    

  
  :type executionRoleArn: string
  :param executionRoleArn: **[REQUIRED]** 

    The updated ARN of the IAM role that grants permissions to execute the query and deliver results.

    

  
  :type state: string
  :param state: 

    The updated state of the scheduled query.

    

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

    
    ::

      {
          'scheduledQueryArn': 'string',
          'name': 'string',
          'description': 'string',
          'queryLanguage': 'CWLI'|'SQL'|'PPL',
          'queryString': 'string',
          'logGroupIdentifiers': [
              'string',
          ],
          'scheduleExpression': 'string',
          'timezone': 'string',
          'startTimeOffset': 123,
          'destinationConfiguration': {
              's3Configuration': {
                  'destinationIdentifier': 'string',
                  'roleArn': 'string'
              }
          },
          'state': 'ENABLED'|'DISABLED',
          'lastTriggeredTime': 123,
          'lastExecutionStatus': 'Running'|'InvalidQuery'|'Complete'|'Failed'|'Timeout',
          'scheduleStartTime': 123,
          'scheduleEndTime': 123,
          'executionRoleArn': 'string',
          'creationTime': 123,
          'lastUpdatedTime': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The ARN of the updated scheduled query.

        
      

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

        The name of the updated scheduled query.

        
      

      - **description** *(string) --* 

        The description of the updated scheduled query.

        
      

      - **queryLanguage** *(string) --* 

        The query language of the updated scheduled query.

        
      

      - **queryString** *(string) --* 

        The query string of the updated scheduled query.

        
      

      - **logGroupIdentifiers** *(list) --* 

        The log groups queried by the updated scheduled query.

        
        

        - *(string) --* 
    
      

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

        The cron expression of the updated scheduled query.

        
      

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

        The timezone of the updated scheduled query.

        
      

      - **startTimeOffset** *(integer) --* 

        The time offset of the updated scheduled query.

        
      

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

        The destination configuration of the updated scheduled query.

        
        

        - **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.

            
      
    
      

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

        The state of the updated scheduled query.

        
      

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

        The timestamp when the updated scheduled query was last executed.

        
      

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

        The status of the most recent execution of the updated scheduled query.

        
      

      - **scheduleStartTime** *(integer) --* 

        The start time of the updated scheduled query.

        
      

      - **scheduleEndTime** *(integer) --* 

        The end time of the updated scheduled query.

        
      

      - **executionRoleArn** *(string) --* 

        The execution role ARN of the updated scheduled query.

        
      

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

        The timestamp when the scheduled query was originally 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.ResourceNotFoundException`

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

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

  