Skip to content

describe_spot_fleet_request_history

describe_spot_fleet_request_history(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    spot_fleet_request_id: Optional[SpotFleetRequestId] = None,
    event_type: Optional[EventType] = None,
    start_time: Optional[DateTime] = None,
    next_token: Optional[String] = None,
    max_results: Optional[DescribeSpotFleetRequestHistoryMaxResults] = None,
) -> DescribeSpotFleetRequestHistoryResponse

Describes the events for the specified Spot Fleet request during the specified time.

Spot 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. Spot 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.

  • spot_fleet_request_id (Optional[SpotFleetRequestId], default: None ) –

    The ID of the Spot Fleet request.

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

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

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

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

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

    The token to include in another request to get the next page of items. This value is null when there are no more items to return.

  • max_results (Optional[DescribeSpotFleetRequestHistoryMaxResults], 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.

Raises:

Examples:

To describe Spot fleet history This example returns the history for the specified Spot fleet starting at the specified time.

>>> client.describe_spot_fleet_request_history(spot_fleet_request_id='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE', start_time='2015-05-26T00:00:00Z')
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_spot_fleet_request_history(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    spot_fleet_request_id: Optional[
        "capo_ec2.types.spot_fleet_request_id.SpotFleetRequestId"
    ] = None,
    event_type: Optional["capo_ec2.types.event_type.EventType"] = None,
    start_time: Optional["capo_ec2.types.date_time.DateTime"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_spot_fleet_request_history_max_results.DescribeSpotFleetRequestHistoryMaxResults"
    ] = None,
) -> "capo_ec2.types.describe_spot_fleet_request_history_response.DescribeSpotFleetRequestHistoryResponse":
    """<p>Describes the events for the specified Spot Fleet request during the specified time.</p> <p>Spot 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. Spot 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>
        spot_fleet_request_id: <p>The ID of the Spot Fleet request.</p>
        event_type: <p>The type of events to describe. By default, all events are described.</p>
        start_time: <p>The starting 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>
        next_token: <p>The token to include in another request to get the next page of items. This value is <code>null</code> when there are no more items to return.</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>

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

    Examples:
        To describe Spot fleet history
        This example returns the history for the specified Spot fleet starting at the specified time.

        >>> client.describe_spot_fleet_request_history(spot_fleet_request_id='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE', start_time='2015-05-26T00:00:00Z')
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_spot_fleet_request_history_request.DescribeSpotFleetRequestHistoryRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_spot_fleet_request_history_response.DescribeSpotFleetRequestHistoryResponse"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_spot_fleet_request_history

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_spot_fleet_request_history.describe_spot_fleet_request_history(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSpotFleetRequestHistory")
    )
    input_: capo_ec2.types.describe_spot_fleet_request_history_request.DescribeSpotFleetRequestHistoryRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if spot_fleet_request_id is not None:
        input_["spot_fleet_request_id"] = spot_fleet_request_id
    if event_type is not None:
        input_["event_type"] = event_type
    if start_time is not None:
        input_["start_time"] = start_time
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output