CloudWatchLogs / Client / update_scheduled_query

update_scheduled_query

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

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'
)
Parameters:
  • identifier (string) –

    [REQUIRED]

    The ARN or name of the scheduled query to update.

  • description (string) – An updated description for the scheduled query.

  • queryLanguage (string) –

    [REQUIRED]

    The updated query language for the scheduled query.

  • queryString (string) –

    [REQUIRED]

    The updated query string to execute.

  • logGroupIdentifiers (list) –

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

    • (string) –

  • scheduleExpression (string) –

    [REQUIRED]

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

  • timezone (string) – The updated timezone for evaluating the schedule expression.

  • startTimeOffset (integer) – The updated time offset in seconds that defines the lookback period for the query.

  • destinationConfiguration (dict) –

    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.

  • scheduleStartTime (integer) – The updated start time for the scheduled query in Unix epoch format.

  • scheduleEndTime (integer) – The updated end time for the scheduled query in Unix epoch format.

  • executionRoleArn (string) –

    [REQUIRED]

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

  • state (string) – The updated state of the scheduled query.

Return type:

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