You can call DescribeReservedInstancesto query the Reserved Instances (RIs) that you have purchased.

Request parameters

Name Type Required Description
Action String Yes A parameter required by the system. Value: DescribeReservedInstances.
RegionId String Yes ID of the region to which the RI belongs. You can call DescribeRegions to view the latest region list.
Scope String No Scope of the RI. Optional values:
  • Region: region-level
  • Zone: zone-level

Default value: Region.

ZoneId String No ID of the zone to which the RI belongs. When Scope is set to Zone, this parameter is required. For information about the zone list, see DescribeZones.
ReservedInstanceName String No Name of the RI
ReservedInstanceId List No ID of the RI
InstanceType String No Instance type of the RI. For more information, see Instance type families.
InstanceTypeFamily String No Instance type family of the RI. For more information, see Instance type families.
Status List No Status of the RI
PageNumber Integer No Page number of the RI list. The start value is 1.

The default value is 1.

PageSize Integer No Number of rows per page for queries per page. The maximum value is 100.

The default value is 10.

Response parameters

Name Type Description
RequestId String Request ID
TotalCount Integer Total number of RIs
PageNumber Integer Page number of the RI list
PageSize Integer Number of rows per page contained in the returned result
ReservedInstances List Array of ReservedInstances, which contain instance information

The following table describes the parameters of the ReservedInstance data type.

Name Type Description
ReservedInstanceName String Name of the RI
RegionId String ID of the region to which the RI belongs
ZoneId String ID of the zone to which the RI belongs
InstanceType String Instance type of the RI
Scope String Scope of the RI
OfferingType String Payment type of the RI
InstanceAmount String Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.)
Status String Status of the RI
CreationTime String Time when the RI is created
ExpiredTime String Expiration time of the RI
StartTime String Time when the RI takes effect

Examples

Request example

https://ecs.aliyuncs.com/?Action=DescribeReservedInstances
&RegionId=cn-hangzhou
&Scope=Region
&<Common request parameters>

Response example

XML format

<DescribeReservedInstancesResponse>
    <ReservedInstance>
	<CreationTime>2018-12-10T12:07Z</CreationTime>
	<ExpiredTime>2019-12-10T16:00Z</ExpiredTime>
	<InstanceAmount>1</InstanceAmount>
	<ReservedInstanceId>ri-xxx</ReservedInstanceId>
	<InstanceType>ecs.g5.large</InstanceType>
	<OfferingType>All Upfront</OfferingType>
	<RegionId>cn-hangzhou</RegionId>
	<ReservedInstanceName>riZ0xzhex2ulpzf53xxxxx</ReservedInstanceName>
	<Scope>region</Scope>
	<StartTime>2018-12-10T12:00Z</StartTime>
	<Status>active</Status>
    </ReservedInstance>
    <ReservedInstance>
	<CreationTime>2018-12-10T12:07Z</CreationTime>
	<ExpiredTime>2019-12-10T16:00Z</ExpiredTime>
	<InstanceAmount>1</InstanceAmount>
	<ReservedInstanceId>ri-xxxx</ReservedInstanceId>
	<InstanceType>ecs.g5.large</InstanceType>
	<OfferingType>All Upfront</OfferingType>
	<RegionId>cn-hangzhou</RegionId>
	<ReservedInstanceName>riZ0xzhex2ulpzfxxxxxx</ReservedInstanceName>
	<Scope>region</Scope>
	<StartTime>2018-12-10T12:00Z</StartTime>
	<Status>active</Status>
    </ReservedInstance>
    <PageNumber>1</PageNumber>
    <PageSize>50</PageSize>
    <Total>2</Total>
</DescribeReservedInstancesResponse>

JSON format

{
    "code":"200",
    "data":{
        "data":[
            {
                "CreationTime":"2018-12-10T12:07Z",
                "ExpiredTime":"2019-12-10T16:00Z",
                "InstanceAmount":1,
                "ReservedInstanceId":"ri-0xzhex2ulpzf53rxme2j",
                "InstanceType":"ecs.g5.large",
                "OfferingType":"All Upfront",
                "RegionId":"cn-hangzhou-test-307",
                "ReservedInstanceName":"riZ0xzhex2ulpzf53rxme2jZ",
                "Scope":"region",
                "StartTime":"2018-12-10T12:00Z",
                "Status":"active"
            }
        ],
        "PageNumber":1,
        "PageSize":50,
        "Total":1
    },
    "httpStatusCode":200,
    "message":"successful",
    "requestId":"E572643C-6A29-49D6-9D4E-6CFA4E063A3E",
    "success":true
}