Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan GetHostReservationPurchasePreview
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanGetHostReservationPurchasePreview
.
- CLI
-
- AWS CLI
-
Untuk mendapatkan pratinjau pembelian untuk Reservasi Tuan Rumah Khusus
Contoh ini memberikan pratinjau biaya untuk Reservasi Host Khusus yang ditentukan untuk Host Khusus yang ditentukan di akun Anda.
Perintah:
aws ec2 get-host-reservation-purchase-preview --offering-id
hro-03f707bf363b6b324
--host-id-seth-013abcd2a00cbd123
Output:
{ "TotalHourlyPrice": "1.499", "Purchase": [ { "HourlyPrice": "1.499", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "HostIdSet": [ "h-013abcd2a00cbd123" ], "UpfrontPrice": "0.000", "Duration": 31536000 } ], "TotalUpfrontPrice": "0.000" }
-
Untuk detail API, lihat GetHostReservationPurchasePreview
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini menampilkan pratinjau pembelian reservasi dengan konfigurasi yang cocok dengan Host Khusus Anda h-01e23f4cd567890f1
Get-EC2HostReservationPurchasePreview -OfferingId hro-0c1f23456789d0ab -HostIdSet h-01e23f4cd567890f1
Output:
CurrencyCode Purchase TotalHourlyPrice TotalUpfrontPrice ------------ -------- ---------------- ----------------- {} 1.307 0.000
-
Untuk detail API, lihat GetHostReservationPurchasePreviewdi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menampilkan pratinjau pembelian reservasi dengan konfigurasi yang cocok dengan Host Khusus Anda h-01e23f4cd567890f1
Get-EC2HostReservationPurchasePreview -OfferingId hro-0c1f23456789d0ab -HostIdSet h-01e23f4cd567890f1
Output:
CurrencyCode Purchase TotalHourlyPrice TotalUpfrontPrice ------------ -------- ---------------- ----------------- {} 1.307 0.000
-
Untuk detail API, lihat GetHostReservationPurchasePreviewdi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-