Skip to content

describe_fleet_instances async

describe_fleet_instances(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
    fleet_id: Optional[FleetId] = None,
    filters: Optional[FilterList] = None,
) -> DescribeFleetInstancesResult

Describes the running instances for the specified EC2 Fleet.

Currently, DescribeFleetInstances does not support fleets of type instant. Instead, use DescribeFleets, specifying the instant fleet ID in the request.

For more information, see Describe your EC2 Fleet 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.

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

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

    The filters.

    • instance-type - The instance type.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_fleet_instances(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = 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,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
) -> "capo_ec2.types.describe_fleet_instances_result.DescribeFleetInstancesResult":
    """<p>Describes the running instances for the specified EC2 Fleet.</p> <note> <p>Currently, <code>DescribeFleetInstances</code> does not support fleets of type <code>instant</code>. Instead, use <code>DescribeFleets</code>, specifying the <code>instant</code> fleet ID in the request.</p> </note> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#monitor-ec2-fleet">Describe your EC2 Fleet</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>
        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>
        filters: <p>The filters.</p> <ul> <li> <p> <code>instance-type</code> - The instance type.</p> </li> </ul>

    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_instances_request.DescribeFleetInstancesRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_fleet_instances_result.DescribeFleetInstancesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_fleet_instances

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeFleetInstances")
    )
    input_: capo_ec2.types.describe_fleet_instances_request.DescribeFleetInstancesRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    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 filters is not None:
        input_["filters"] = filters

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