EC2 / Client / describe_spot_fleet_instances

describe_spot_fleet_instances#

EC2.Client.describe_spot_fleet_instances(**kwargs)#

Describes the running instances for the specified Spot Fleet.

See also: AWS API Documentation

Request Syntax

response = client.describe_spot_fleet_instances(
    DryRun=True|False,
    MaxResults=123,
    NextToken='string',
    SpotFleetRequestId='string'
)
Parameters:
  • DryRun (boolean) – 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.

  • MaxResults (integer) – 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.

  • NextToken (string) – 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.

  • SpotFleetRequestId (string) –

    [REQUIRED]

    The ID of the Spot Fleet request.

Return type:

dict

Returns:

Response Syntax

{
    'ActiveInstances': [
        {
            'InstanceId': 'string',
            'InstanceType': 'string',
            'SpotInstanceRequestId': 'string',
            'InstanceHealth': 'healthy'|'unhealthy'
        },
    ],
    'NextToken': 'string',
    'SpotFleetRequestId': 'string'
}

Response Structure

  • (dict) –

    Contains the output of DescribeSpotFleetInstances.

    • ActiveInstances (list) –

      The running instances. This list is refreshed periodically and might be out of date.

      • (dict) –

        Describes a running instance in a Spot Fleet.

        • InstanceId (string) –

          The ID of the instance.

        • InstanceType (string) –

          The instance type.

        • SpotInstanceRequestId (string) –

          The ID of the Spot Instance request.

        • InstanceHealth (string) –

          The health status of the instance. If the status of either the instance status check or the system status check is impaired, the health status of the instance is unhealthy. Otherwise, the health status is healthy.

    • NextToken (string) –

      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.

    • SpotFleetRequestId (string) –

      The ID of the Spot Fleet request.

Examples

This example lists the Spot Instances associated with the specified Spot fleet.

response = client.describe_spot_fleet_instances(
    SpotFleetRequestId='sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
)

print(response)

Expected Output:

{
    'ActiveInstances': [
        {
            'InstanceId': 'i-1234567890abcdef0',
            'InstanceType': 'm3.medium',
            'SpotInstanceRequestId': 'sir-08b93456',
        },
    ],
    'SpotFleetRequestId': 'sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE',
    'ResponseMetadata': {
        '...': '...',
    },
}