Skip to content

describe_spot_fleet_instances

describe_spot_fleet_instances(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    spot_fleet_request_id: Optional[SpotFleetRequestId] = None,
    next_token: Optional[String] = None,
    max_results: Optional[DescribeSpotFleetInstancesMaxResults] = None,
) -> DescribeSpotFleetInstancesResponse

Describes the running instances for the specified Spot Fleet.

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.

  • 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[DescribeSpotFleetInstancesMaxResults], 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 the Spot Instances associated with a Spot fleet This example lists the Spot Instances associated with the specified Spot fleet.

>>> client.describe_spot_fleet_instances(spot_fleet_request_id='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE')
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_spot_fleet_instances(
    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,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_spot_fleet_instances_max_results.DescribeSpotFleetInstancesMaxResults"
    ] = None,
) -> "capo_ec2.types.describe_spot_fleet_instances_response.DescribeSpotFleetInstancesResponse":
    """<p>Describes the running instances for the specified Spot Fleet.</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>
        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 the Spot Instances associated with a Spot fleet
        This example lists the Spot Instances associated with the specified Spot fleet.

        >>> client.describe_spot_fleet_instances(spot_fleet_request_id='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE')
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_spot_fleet_instances_request.DescribeSpotFleetInstancesRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_spot_fleet_instances_response.DescribeSpotFleetInstancesResponse"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_spot_fleet_instances

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSpotFleetInstances")
    )
    input_: capo_ec2.types.describe_spot_fleet_instances_request.DescribeSpotFleetInstancesRequest = {}
    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 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