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 DescribeScheduledInstances dengan CLI
Contoh kode berikut menunjukkan cara menggunakanDescribeScheduledInstances.
- CLI
-
- AWS CLI
-
Untuk mendeskripsikan Instans Terjadwal Anda
Contoh ini menjelaskan Instance Terjadwal yang ditentukan.
Perintah:
aws ec2 describe-scheduled-instances --scheduled-instance-idssci-1234-1234-1234-1234-123456789012Output:
{ "ScheduledInstanceSet": [ { "AvailabilityZone": "us-west-2b", "ScheduledInstanceId": "sci-1234-1234-1234-1234-123456789012", "HourlyPrice": "0.095", "CreateDate": "2016-01-25T21:43:38.612Z", "Recurrence": { "OccurrenceDaySet": [ 1 ], "Interval": 1, "Frequency": "Weekly", "OccurrenceRelativeToEnd": false, "OccurrenceUnit": "" }, "Platform": "Linux/UNIX", "TermEndDate": "2017-01-31T09:00:00Z", "InstanceCount": 1, "SlotDurationInHours": 32, "TermStartDate": "2016-01-31T09:00:00Z", "NetworkPlatform": "EC2-VPC", "TotalScheduledInstanceHours": 1696, "NextSlotStartTime": "2016-01-31T09:00:00Z", "InstanceType": "c4.large" } ] }Contoh ini menjelaskan semua Instans Terjadwal Anda.
Perintah:
aws ec2 describe-scheduled-instances-
Untuk detail API, lihat DescribeScheduledInstances
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini menjelaskan Instance Terjadwal yang ditentukan.
Get-EC2ScheduledInstance -ScheduledInstanceId sci-1234-1234-1234-1234-123456789012Output:
AvailabilityZone : us-west-2b CreateDate : 1/25/2016 1:43:38 PM HourlyPrice : 0.095 InstanceCount : 1 InstanceType : c4.large NetworkPlatform : EC2-VPC NextSlotStartTime : 1/31/2016 1:00:00 AM Platform : Linux/UNIX PreviousSlotEndTime : Recurrence : Amazon.EC2.Model.ScheduledInstanceRecurrence ScheduledInstanceId : sci-1234-1234-1234-1234-123456789012 SlotDurationInHours : 32 TermEndDate : 1/31/2017 1:00:00 AM TermStartDate : 1/31/2016 1:00:00 AM TotalScheduledInstanceHours : 1696Contoh 2: Contoh ini menjelaskan semua Instans Terjadwal Anda.
Get-EC2ScheduledInstance-
Untuk detail API, lihat DescribeScheduledInstancesdi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menjelaskan Instance Terjadwal yang ditentukan.
Get-EC2ScheduledInstance -ScheduledInstanceId sci-1234-1234-1234-1234-123456789012Output:
AvailabilityZone : us-west-2b CreateDate : 1/25/2016 1:43:38 PM HourlyPrice : 0.095 InstanceCount : 1 InstanceType : c4.large NetworkPlatform : EC2-VPC NextSlotStartTime : 1/31/2016 1:00:00 AM Platform : Linux/UNIX PreviousSlotEndTime : Recurrence : Amazon.EC2.Model.ScheduledInstanceRecurrence ScheduledInstanceId : sci-1234-1234-1234-1234-123456789012 SlotDurationInHours : 32 TermEndDate : 1/31/2017 1:00:00 AM TermStartDate : 1/31/2016 1:00:00 AM TotalScheduledInstanceHours : 1696Contoh 2: Contoh ini menjelaskan semua Instans Terjadwal Anda.
Get-EC2ScheduledInstance-
Untuk detail API, lihat DescribeScheduledInstancesdi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-