Skip to content

list_automation_events async

list_automation_events(
    *,
    config_overrides: Optional[AsyncComputeOptimizerAutomationClientConfig] = None,
    filters: Optional[AutomationEventFilterList] = None,
    organizational_unit_ids: Optional[OrganizationalUnitIds] = None,
    start_time_inclusive: Optional[datetime] = None,
    end_time_exclusive: Optional[datetime] = None,
    max_results: Optional[int] = None,
    next_token: Optional[NextToken] = None,
) -> ListAutomationEventsResponse

Lists automation events based on specified filters. You can retrieve events that were created within the past year.

Parameters:

  • filters (Optional[AutomationEventFilterList], default: None ) –

    The filters to apply to the list of automation events.

  • organizational_unit_ids (Optional[OrganizationalUnitIds], default: None ) –

    The organizational unit (OU) or organization root IDs to use to filter the results. The response includes events for accounts in the specified OUs and their child OUs. Only the management account or a delegated administrator can specify this parameter.

  • start_time_inclusive (Optional[datetime], default: None ) –

    The start of the time range to query for events.

  • end_time_exclusive (Optional[datetime], default: None ) –

    The end of the time range to query for events.

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

    The maximum number of automation events to return in a single response. If you don't specify a value, the default is 100.

  • next_token (Optional[NextToken], default: None ) –

    The token for the next page of results.

Raises:

Source code in docs_src/capo_compute_optimizer_automation/_services/async_compute_optimizer_automation.py
async def list_automation_events(
    self,
    *,
    config_overrides: Optional[AsyncComputeOptimizerAutomationClientConfig] = None,
    filters: Optional[
        "capo_compute_optimizer_automation.types.automation_event_filter_list.AutomationEventFilterList"
    ] = None,
    organizational_unit_ids: Optional[
        "capo_compute_optimizer_automation.types.organizational_unit_ids.OrganizationalUnitIds"
    ] = None,
    start_time_inclusive: Optional[datetime.datetime] = None,
    end_time_exclusive: Optional[datetime.datetime] = None,
    max_results: Optional[int] = None,
    next_token: Optional[
        "capo_compute_optimizer_automation.types.next_token.NextToken"
    ] = None,
) -> "capo_compute_optimizer_automation.types.list_automation_events_response.ListAutomationEventsResponse":
    """<p>Lists automation events based on specified filters. You can retrieve events that were created within the past year. </p>

    Args:
        filters: <p> The filters to apply to the list of automation events. </p>
        organizational_unit_ids: <p> The organizational unit (OU) or organization root IDs to use to filter the results. The response includes events for accounts in the specified OUs and their child OUs. Only the management account or a delegated administrator can specify this parameter. </p>
        start_time_inclusive: <p> The start of the time range to query for events. </p>
        end_time_exclusive: <p> The end of the time range to query for events. </p>
        max_results: <p> The maximum number of automation events to return in a single response. If you don't specify a value, the default is 100. </p>
        next_token: <p> The token for the next page of results. </p>

    Raises:
        capo_compute_optimizer_automation.errors.access_denied_exception.AccessDeniedException: <p> You do not have sufficient permissions to perform this action. </p>
        capo_compute_optimizer_automation.errors.forbidden_exception.ForbiddenException: <p> You are not authorized to perform this action. </p>
        capo_compute_optimizer_automation.errors.internal_server_exception.InternalServerException: <p> An internal error occurred while processing the request. </p>
        capo_compute_optimizer_automation.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p> One or more parameter values are not valid. </p>
        capo_compute_optimizer_automation.errors.opt_in_required_exception.OptInRequiredException: <p> The account must be opted in to Compute Optimizer Automation before performing this action. </p>
        capo_compute_optimizer_automation.errors.service_unavailable_exception.ServiceUnavailableException: <p> The service is temporarily unavailable. </p>
        capo_compute_optimizer_automation.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
        capo_compute_optimizer_automation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_compute_optimizer_automation.types.list_automation_events_request.ListAutomationEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_compute_optimizer_automation.types.list_automation_events_response.ListAutomationEventsResponse"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.aws_json1_0.list_automation_events

            (
                output,
                http_response,
            ) = await capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.aws_json1_0.list_automation_events.async_list_automation_events(
                req.options, req.input
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.rpcv2_cbor.list_automation_events

            (
                output,
                http_response,
            ) = await capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.rpcv2_cbor.list_automation_events.async_list_automation_events(
                req.options, req.input
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAutomationEvents")
    )
    input_: capo_compute_optimizer_automation.types.list_automation_events_request.ListAutomationEventsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if organizational_unit_ids is not None:
        input_["organizational_unit_ids"] = organizational_unit_ids
    if start_time_inclusive is not None:
        input_["start_time_inclusive"] = start_time_inclusive
    if end_time_exclusive is not None:
        input_["end_time_exclusive"] = end_time_exclusive
    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