Skip to content

update_scheduled_query async

update_scheduled_query(
    identifier: ScheduledQueryIdentifier,
    query_language: QueryLanguage,
    query_string: QueryString,
    schedule_expression: ScheduleExpression,
    execution_role_arn: RoleArn,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    description: Optional[ScheduledQueryDescription] = None,
    log_group_identifiers: Optional[ScheduledQueryLogGroupIdentifiers] = None,
    timezone: Optional[ScheduleTimezone] = None,
    start_time_offset: Optional[StartTimeOffset] = None,
    end_time_offset: Optional[EndTimeOffset] = None,
    destination_configuration: Optional[DestinationConfiguration] = None,
    schedule_start_time: Optional[Timestamp] = None,
    schedule_end_time: Optional[Timestamp] = None,
    state: Optional[ScheduledQueryState] = None,
) -> UpdateScheduledQueryResponse

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

Parameters:

  • identifier (ScheduledQueryIdentifier) –

    The ARN or name of the scheduled query to update.

  • description (Optional[ScheduledQueryDescription], default: None ) –

    An updated description for the scheduled query.

  • query_language (QueryLanguage) –

    The updated query language for the scheduled query.

  • query_string (QueryString) –

    The updated query string to execute.

  • log_group_identifiers (Optional[ScheduledQueryLogGroupIdentifiers], default: None ) –

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

  • schedule_expression (ScheduleExpression) –

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

  • timezone (Optional[ScheduleTimezone], default: None ) –

    The updated timezone for evaluating the schedule expression.

  • start_time_offset (Optional[StartTimeOffset], default: None ) –

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

  • end_time_offset (Optional[EndTimeOffset], default: None ) –

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

  • destination_configuration (Optional[DestinationConfiguration], default: None ) –

    The updated configuration for where to deliver query results.

  • schedule_start_time (Optional[Timestamp], default: None ) –

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

  • schedule_end_time (Optional[Timestamp], default: None ) –

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

  • execution_role_arn (RoleArn) –

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

  • state (Optional[ScheduledQueryState], default: None ) –

    The updated state of the scheduled query.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def update_scheduled_query(
    self,
    identifier: "capo_cloudwatch_logs.types.scheduled_query_identifier.ScheduledQueryIdentifier",
    query_language: "capo_cloudwatch_logs.types.query_language.QueryLanguage",
    query_string: "capo_cloudwatch_logs.types.query_string.QueryString",
    schedule_expression: "capo_cloudwatch_logs.types.schedule_expression.ScheduleExpression",
    execution_role_arn: "capo_cloudwatch_logs.types.role_arn.RoleArn",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    description: Optional[
        "capo_cloudwatch_logs.types.scheduled_query_description.ScheduledQueryDescription"
    ] = None,
    log_group_identifiers: Optional[
        "capo_cloudwatch_logs.types.scheduled_query_log_group_identifiers.ScheduledQueryLogGroupIdentifiers"
    ] = None,
    timezone: Optional[
        "capo_cloudwatch_logs.types.schedule_timezone.ScheduleTimezone"
    ] = None,
    start_time_offset: Optional[
        "capo_cloudwatch_logs.types.start_time_offset.StartTimeOffset"
    ] = None,
    end_time_offset: Optional[
        "capo_cloudwatch_logs.types.end_time_offset.EndTimeOffset"
    ] = None,
    destination_configuration: Optional[
        "capo_cloudwatch_logs.types.destination_configuration.DestinationConfiguration"
    ] = None,
    schedule_start_time: Optional[
        "capo_cloudwatch_logs.types.timestamp.Timestamp"
    ] = None,
    schedule_end_time: Optional[
        "capo_cloudwatch_logs.types.timestamp.Timestamp"
    ] = None,
    state: Optional[
        "capo_cloudwatch_logs.types.scheduled_query_state.ScheduledQueryState"
    ] = None,
) -> "capo_cloudwatch_logs.types.update_scheduled_query_response.UpdateScheduledQueryResponse":
    """<p>Updates an existing scheduled query with new configuration. This operation uses PUT semantics, allowing modification of query parameters, schedule, and destinations.</p>

    Args:
        identifier: <p>The ARN or name of the scheduled query to update.</p>
        description: <p>An updated description for the scheduled query.</p>
        query_language: <p>The updated query language for the scheduled query.</p>
        query_string: <p>The updated query string to execute.</p>
        log_group_identifiers: <p>The updated array of log group names or ARNs to query.</p>
        schedule_expression: <p>The updated cron expression that defines when the scheduled query runs.</p>
        timezone: <p>The updated timezone for evaluating the schedule expression.</p>
        start_time_offset: <p>The updated time offset in seconds that defines the lookback period for the query.</p>
        end_time_offset: <p>The updated time offset in seconds that defines the end of the lookback period for the query.</p>
        destination_configuration: <p>The updated configuration for where to deliver query results.</p>
        schedule_start_time: <p>The updated start time for the scheduled query in Unix epoch format.</p>
        schedule_end_time: <p>The updated end time for the scheduled query in Unix epoch format.</p>
        execution_role_arn: <p>The updated ARN of the IAM role that grants permissions to execute the query and deliver results.</p>
        state: <p>The updated state of the scheduled query.</p>

    Raises:
        capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_cloudwatch_logs.errors.conflict_exception.ConflictException: <p>This operation attempted to create a resource that already exists.</p>
        capo_cloudwatch_logs.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_cloudwatch_logs.errors.validation_exception.ValidationException: <p>One of the parameters for the request is not valid.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.update_scheduled_query_request.UpdateScheduledQueryRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.update_scheduled_query_response.UpdateScheduledQueryResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.update_scheduled_query

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.update_scheduled_query.async_update_scheduled_query(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateScheduledQuery")
    )
    input_: capo_cloudwatch_logs.types.update_scheduled_query_request.UpdateScheduledQueryRequest = {
        "identifier": identifier,
        "query_language": query_language,
        "query_string": query_string,
        "schedule_expression": schedule_expression,
        "execution_role_arn": execution_role_arn,
    }
    if description is not None:
        input_["description"] = description
    if log_group_identifiers is not None:
        input_["log_group_identifiers"] = log_group_identifiers
    if timezone is not None:
        input_["timezone"] = timezone
    if start_time_offset is not None:
        input_["start_time_offset"] = start_time_offset
    if end_time_offset is not None:
        input_["end_time_offset"] = end_time_offset
    if destination_configuration is not None:
        input_["destination_configuration"] = destination_configuration
    if schedule_start_time is not None:
        input_["schedule_start_time"] = schedule_start_time
    if schedule_end_time is not None:
        input_["schedule_end_time"] = schedule_end_time
    if state is not None:
        input_["state"] = state

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output