AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DescribeSpotFleetRequests
与 a 一起使用 CLI
以下代码示例演示如何使用 DescribeSpotFleetRequests
。
- CLI
-
- AWS CLI
-
描述您的 Spot 队列请求
此示例描述了您的所有 Spot 队列请求。
命令:
aws ec2 describe-spot-fleet-requests
输出:
{ "SpotFleetRequestConfigs": [ { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "SpotFleetRequestConfig": { "TargetCapacity": 20, "LaunchSpecifications": [ { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "cc2.8xlarge", "ImageId": "ami-1a2b3c4d" }, { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "r3.8xlarge", "ImageId": "ami-1a2b3c4d" } ], "SpotPrice": "0.05", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" }, "SpotFleetRequestState": "active" }, { "SpotFleetRequestId": "sfr-306341ed-9739-402e-881b-ce47bEXAMPLE", "SpotFleetRequestConfig": { "TargetCapacity": 20, "LaunchSpecifications": [ { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-6e7f829e", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "m3.medium", "ImageId": "ami-1a2b3c4d" } ], "SpotPrice": "0.05", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" }, "SpotFleetRequestState": "active" } ] }
描述 Spot 队列请求
此示例描述了指定的 Spot 队列请求。
命令:
aws ec2 describe-spot-fleet-requests --spot-fleet-request-ids
sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE
输出:
{ "SpotFleetRequestConfigs": [ { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "SpotFleetRequestConfig": { "TargetCapacity": 20, "LaunchSpecifications": [ { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "cc2.8xlarge", "ImageId": "ami-1a2b3c4d" }, { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "r3.8xlarge", "ImageId": "ami-1a2b3c4d" } ], "SpotPrice": "0.05", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" }, "SpotFleetRequestState": "active" } ] }
-
有关API详细信息,请参阅 “DescribeSpotFleetRequests AWS CLI
命令参考”。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:此示例描述了指定的 Spot 队列请求。
Get-EC2SpotFleetRequest -SpotFleetRequestId sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE | format-list
输出:
ConfigData : Amazon.EC2.Model.SpotFleetRequestConfigData CreateTime : 12/26/2015 8:23:33 AM SpotFleetRequestId : sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE SpotFleetRequestState : active
示例 2:此示例描述了您的所有竞价型队列请求。
Get-EC2SpotFleetRequest
-
有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考DescribeSpotFleetRequests中的。
-
DescribeSpotFleetRequestHistory
DescribeSpotInstanceRequests