Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzare DescribeHostReservationOfferings con una CLI
I seguenti esempi di codice mostrano come usare DescribeHostReservationOfferings.
- CLI
-
- AWS CLI
-
Come descrivere le offerte per le prenotazioni degli host dedicati
Quanto segue
describe-host-reservation-offeringsL'esempio descrive le prenotazioni di host dedicati per la famiglia di istanze M4 disponibili per l'acquisto.aws ec2 describe-host-reservation-offerings \ --filterName=instance-family,Values=m4Output:
{ "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 } ] }Per ulteriori informazioni, consulta Prezzi e fatturazione degli host dedicati di Amazon EC2 nel Guida per l'utente di Amazon EC2.
-
Per i dettagli sull'API, vedi DescribeHostReservationOfferings
nel AWS CLI Riferimento al comando.
-
- PowerShell
-
- Utensili per PowerShell V4
-
Esempio 1: questo esempio descrive le prenotazioni di host dedicati disponibili per l'acquisto per il filtro «instance-family» specificato dove PaymentOption è 'NoUpfront'
Get-EC2HostReservationOffering -Filter @{Name="instance-family";Values="m4"} | Where-Object PaymentOption -eq NoUpfrontOutput:
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-
Per i dettagli sull'API, consulta DescribeHostReservationOfferings nel AWS Strumenti per PowerShell Riferimento al cmdlet (V4).
-
- Utensili per PowerShell V5
-
Esempio 1: questo esempio descrive le prenotazioni di host dedicati disponibili per l'acquisto per il filtro «instance-family» specificato dove PaymentOption è 'NoUpfront'
Get-EC2HostReservationOffering -Filter @{Name="instance-family";Values="m4"} | Where-Object PaymentOption -eq NoUpfrontOutput:
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-
Per i dettagli sull'API, consulta DescribeHostReservationOfferings nel AWS Strumenti per PowerShell Riferimento al cmdlet (V5).
-
Per un elenco completo di AWS Guide per sviluppatori SDK ed esempi di codice, consulta Crea EC2 risorse Amazon utilizzando un AWS SDK. Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell'SDK.