Skip to content

describe_fleet_history async

describe_fleet_history(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    event_type: Optional[FleetEventType] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
    fleet_id: Optional[FleetId] = None,
    start_time: Optional[DateTime] = None,
) -> DescribeFleetHistoryResult

Describes the events for the specified EC2 Fleet during the specified time.

EC2 Fleet events are delayed by up to 30 seconds before they can be described. This ensures that you can query by the last evaluated time and not miss a recorded event. EC2 Fleet events are available for 48 hours.

For more information, see Monitor fleet events using Amazon EventBridge in the Amazon EC2 User Guide.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • event_type (Optional[FleetEventType], default: None ) –

    The type of events to describe. By default, all events are described.

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

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

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

    The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

  • fleet_id (Optional[FleetId], default: None ) –

    The ID of the EC2 Fleet.

  • start_time (Optional[DateTime], default: None ) –

    The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_fleet_history(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    event_type: Optional["capo_ec2.types.fleet_event_type.FleetEventType"] = None,
    max_results: Optional["capo_ec2.types.integer.Integer"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    fleet_id: Optional["capo_ec2.types.fleet_id.FleetId"] = None,
    start_time: Optional["capo_ec2.types.date_time.DateTime"] = None,
) -> "capo_ec2.types.describe_fleet_history_result.DescribeFleetHistoryResult":
    """<p>Describes the events for the specified EC2 Fleet during the specified time.</p> <p>EC2 Fleet events are delayed by up to 30 seconds before they can be described. This ensures that you can query by the last evaluated time and not miss a recorded event. EC2 Fleet events are available for 48 hours.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/fleet-monitor.html">Monitor fleet events using Amazon EventBridge</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        event_type: <p>The type of events to describe. By default, all events are described.</p>
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
        fleet_id: <p>The ID of the EC2 Fleet.</p>
        start_time: <p>The start date and time for the events, in UTC format (for example, <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z).</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_fleet_history_request.DescribeFleetHistoryRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_fleet_history_result.DescribeFleetHistoryResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_fleet_history

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_fleet_history.async_describe_fleet_history(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeFleetHistory")
    )
    input_: capo_ec2.types.describe_fleet_history_request.DescribeFleetHistoryRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if event_type is not None:
        input_["event_type"] = event_type
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if fleet_id is not None:
        input_["fleet_id"] = fleet_id
    if start_time is not None:
        input_["start_time"] = start_time

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