Skip to content

get_scheduled_query_history async

get_scheduled_query_history(
    identifier: ScheduledQueryIdentifier,
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    execution_statuses: Optional[ExecutionStatusList] = None,
    max_results: Optional[GetScheduledQueryHistoryMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetScheduledQueryHistoryResponse

Retrieves the execution history of a scheduled query within a specified time range, including query results and destination processing status.

Parameters:

  • identifier (ScheduledQueryIdentifier) –

    The ARN or name of the scheduled query to retrieve history for.

  • start_time (Timestamp) –

    The start time for the history query in Unix epoch format.

  • end_time (Timestamp) –

    The end time for the history query in Unix epoch format.

  • execution_statuses (Optional[ExecutionStatusList], default: None ) –

    An array of execution statuses to filter the history results. Only executions with the specified statuses are returned.

  • max_results (Optional[GetScheduledQueryHistoryMaxResults], default: None ) –

    The maximum number of history records to return. Valid range is 1 to 1000.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def get_scheduled_query_history(
    self,
    identifier: "capo_cloudwatch_logs.types.scheduled_query_identifier.ScheduledQueryIdentifier",
    start_time: "capo_cloudwatch_logs.types.timestamp.Timestamp",
    end_time: "capo_cloudwatch_logs.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
    execution_statuses: Optional[
        "capo_cloudwatch_logs.types.execution_status_list.ExecutionStatusList"
    ] = None,
    max_results: Optional[
        "capo_cloudwatch_logs.types.get_scheduled_query_history_max_results.GetScheduledQueryHistoryMaxResults"
    ] = None,
    next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
) -> "capo_cloudwatch_logs.types.get_scheduled_query_history_response.GetScheduledQueryHistoryResponse":
    """<p>Retrieves the execution history of a scheduled query within a specified time range, including query results and destination processing status.</p>

    Args:
        identifier: <p>The ARN or name of the scheduled query to retrieve history for.</p>
        start_time: <p>The start time for the history query in Unix epoch format.</p>
        end_time: <p>The end time for the history query in Unix epoch format.</p>
        execution_statuses: <p>An array of execution statuses to filter the history results. Only executions with the specified statuses are returned.</p>
        max_results: <p>The maximum number of history records to return. Valid range is 1 to 1000.</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.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.get_scheduled_query_history_request.GetScheduledQueryHistoryRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.get_scheduled_query_history_response.GetScheduledQueryHistoryResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.get_scheduled_query_history

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetScheduledQueryHistory")
    )
    input_: capo_cloudwatch_logs.types.get_scheduled_query_history_request.GetScheduledQueryHistoryRequest = {
        "identifier": identifier,
        "start_time": start_time,
        "end_time": end_time,
    }
    if execution_statuses is not None:
        input_["execution_statuses"] = execution_statuses
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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