Use DescribeScheduledInstances with a CLI
The following code examples show how to use DescribeScheduledInstances.
- CLI
-
- AWS CLI
-
To describe your Scheduled Instances
The following
describe-scheduled-instancesexample describes the specified Scheduled Instance.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" } ] }The following
describe-scheduled-instancesexample describes all your Scheduled Instances.aws ec2 describe-scheduled-instancesFor more information, see Amazon EC2 billing and purchasing options in the Amazon EC2 User Guide.
-
For API details, see DescribeScheduledInstances
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example describes the specified Scheduled Instance.
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 : 1696Example 2: This example describes all your Scheduled Instances.
Get-EC2ScheduledInstance-
For API details, see DescribeScheduledInstances in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example describes the specified Scheduled Instance.
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 : 1696Example 2: This example describes all your Scheduled Instances.
Get-EC2ScheduledInstance-
For API details, see DescribeScheduledInstances in AWS Tools for PowerShell Cmdlet Reference (V5).
-
For a complete list of AWS SDK developer guides and code examples, see Create Amazon EC2 resources using an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.