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'
)
DryRunOperation
. Otherwise, it is UnauthorizedOperation
.null
when there are no more items to return.[REQUIRED]
The ID of the Spot Fleet request.
dict
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': {
'...': '...',
},
}