Queries purchased reserved instances.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:DescribeReservedInstances | get | *ReservedInstance acs:ecs:{#regionId}:{#accountId}:reservedinstance/* *ReservedInstance acs:ecs:{#regionId}:{#accountId}:reservedinstance/{#reservedinstanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the instances. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
PageNumber | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries per page. Maximum value: 100. Default value: 10. | 50 |
Tag | array<object> | No | The tags to add to the instances. | |
object | No | The tags to add to the instances. | ||
Key | string | No | The key of tag N to add to the reserved instance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun. Up to 1,000 resources with the specified tags can be returned in the response. To query more than 1,000 resources with the specified tags, call the ListTagResources operation. | TestKey |
Value | string | No | The value of tag N to add to the reserved instance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with acs:. | TestValue |
ZoneId | string | No | The zone ID of the reserved instances. This parameter is required when Scope is set to Zone. You can call the DescribeZones operation to query the most recent zone list. | cn-hangzhou-z |
ReservedInstanceName | string | No | The name of the reserved instance. | testReservedInstanceName |
LockReason | string | No | The reason why the instance is locked. Valid values:
| security |
InstanceType | string | No | The instance type. For more information, see Instance families. | ecs.g5.large |
InstanceTypeFamily | string | No | The instance family. For more information, see Instance families. | ecs.g5 |
Scope | string | No | The scope of the reserved instances. Valid values:
Default value: Region. | Region |
OfferingType | string | No | The payment option of the reserved instances. Valid values:
| All Upfront |
AllocationType | string | No | The allocation type. Valid values:
Default value: Normal. | Normal |
ReservedInstanceId | array | No | The ID of reserved instance N. Valid values of N: 1 to 100. | |
string | No | The ID of reserved instance N. Valid values of N: 1 to 100. | ri-bpzhex2ulpzf53**** | |
Status | array | No | The status of reserved instance N. Valid values of N: 1 to 100. Valid values:
| |
string | No | The status of reserved instance N. Valid values of N: 1 to 100. Valid values:
| Active |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageSize": 1,
"RequestId": "E572643C-6A29-49D6-9D4E-6CFA4E063A3E",
"PageNumber": 1,
"TotalCount": 1,
"ReservedInstances": {
"ReservedInstance": [
{
"Status": "Active",
"CreationTime": "2018-12-10T12:07Z",
"ReservedInstanceName": "riZbpzhex2ulpzf53****",
"ReservedInstanceId": "ri-bpzhex2ulpzf53****",
"InstanceType": "ecs.g5.large",
"InstanceAmount": 10,
"RegionId": "cn-hangzhou",
"OfferingType": "All Upfront",
"StartTime": "2018-12-10T12:00Z",
"Description": "testDescription",
"AllocationStatus": "allocated",
"ExpiredTime": "2019-12-10T12:07Z",
"ResourceGroupId": "EcsDocTest",
"ZoneId": "cn-hangzhou-z",
"Platform": "Linux",
"Scope": "region",
"OperationLocks": {
"OperationLock": [
{
"LockReason": "security"
}
]
},
"Tags": {
"Tag": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParamter.RegionId | The regionId should not be null. | The RegionId parameter is required. |
400 | InvalidRegion.NotFound | The specified parameter RegionId is not valid. | The specified RegionId parameter is invalid. |
400 | InvalidZone.NotFound | The specified parameter ZoneId is not valid. | The specified ZoneId parameter is invalid. |
400 | InvalidReservedInstanceOfferingType.ValueNotSupported | the OfferingType is not supported | - |
400 | InvalidReservedInstanceOfferingClass.ValueNotSupported | the OfferingClass is not supported | - |
400 | OperationDenied | The specified InstanceType or Zone is not authorized for current user. | - |
400 | InvalidEndTime.ValueNotSupported | The specified endTime is out of the permitted range. | The specified end time is invalid. |
400 | InvalidReservedInstanceLockReason.ValueNotSupported | The specified LockReason is not supported. | - |
400 | InvalidReservedInstanceStatus.ValueNotSupported | The specified Status is not supported. | - |
400 | InvalidAllocationType.ValueNotSupported | The specified AllocationType is not supported. | The specified AllocationType parameter is invalid. |
404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | The specified RegionId parameter does not exist. Check whether the service is available in the specified region. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|