AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DescribeHostReservationOfferings
与 a 一起使用 CLI
以下代码示例演示如何使用 DescribeHostReservationOfferings
。
- CLI
-
- AWS CLI
-
描述专用主机预留服务
此示例描述了可供购买的 M4 实例系列的专用主机预留。
命令:
aws ec2 describe-host-reservation-offerings --filter
Name=instance-family,Values=m4
输出:
{ "OfferingSet": [ { "HourlyPrice": "1.499", "OfferingId": "hro-03f707bf363b6b324", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "UpfrontPrice": "0.000", "Duration": 31536000 }, { "HourlyPrice": "1.045", "OfferingId": "hro-0ef9181cabdef7a02", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "UpfrontPrice": "0.000", "Duration": 94608000 }, { "HourlyPrice": "0.714", "OfferingId": "hro-04567a15500b92a51", "InstanceFamily": "m4", "PaymentOption": "PartialUpfront", "UpfrontPrice": "6254.000", "Duration": 31536000 }, { "HourlyPrice": "0.484", "OfferingId": "hro-0d5d7a9d23ed7fbfe", "InstanceFamily": "m4", "PaymentOption": "PartialUpfront", "UpfrontPrice": "12720.000", "Duration": 94608000 }, { "HourlyPrice": "0.000", "OfferingId": "hro-05da4108ca998c2e5", "InstanceFamily": "m4", "PaymentOption": "AllUpfront", "UpfrontPrice": "23913.000", "Duration": 94608000 }, { "HourlyPrice": "0.000", "OfferingId": "hro-0a9f9be3b95a3dc8f", "InstanceFamily": "m4", "PaymentOption": "AllUpfront", "UpfrontPrice": "12257.000", "Duration": 31536000 } ] }
-
有关API详细信息,请参阅 “DescribeHostReservationOfferings AWS CLI
命令参考”。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:此示例描述了可为给定过滤器 “实例系列” 购买的专用主机预留 PaymentOption ,其中 “” NoUpfront
Get-EC2HostReservationOffering -Filter @{Name="instance-family";Values="m4"} | Where-Object PaymentOption -eq NoUpfront
输出:
CurrencyCode : Duration : 94608000 HourlyPrice : 1.307 InstanceFamily : m4 OfferingId : hro-0c1f234567890d9ab PaymentOption : NoUpfront UpfrontPrice : 0.000 CurrencyCode : Duration : 31536000 HourlyPrice : 1.830 InstanceFamily : m4 OfferingId : hro-04ad12aaaf34b5a67 PaymentOption : NoUpfront UpfrontPrice : 0.000
-
有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考DescribeHostReservationOfferings中的。
-
DescribeFlowLogs
DescribeHosts