Queries the renewal price of a subscription Elastic Compute Service (ECS) resource. Renewal prices of only subscription resources can be queried.
Operation description
-
You can call this operation to query the price for renewing a subscription instance for a specific period of time or to a synchronized expiration date.
-
Take note of the following items:
- If you specify only the required parameters, the price for renewing an instance for one month is queried by default.
- The renewal period-related parameter pair (
Period
andPeriodUnit
) and the synchronized expiration date-related parameter (ExpectedRenewDay
) are mutually exclusive. You cannot set these parameters together to query the prices for renewing a specified instance for a period of time and to a synchronized expiration date at the same time.
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:DescribeRenewalPrice | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the instance. You can call the DescribeRegions operation to query the most recent list of regions. | cn-hangzhou |
ResourceType | string | No | The type of the resource. Set the value to instance. Default value: instance. | instance |
ResourceId | string | Yes | The ID of the resource. If the | i-bp1f2o4ldh8l29zv**** |
Period | integer | No | The renewal period. Valid values:
Default value: 1. Note
The renewal period-related parameter pair ( Period and PeriodUnit ) and the ExpectedRenewDay parameter are mutually exclusive.
| 1 |
PriceUnit | string | No | The unit of the renewal period. Valid values:
Default value: Month. | Month |
ExpectedRenewDay | integer | No | The synchronized expiration date. If you specify this parameter, the price for renewing a specified instance to the specified synchronized expiration date is queried. Valid values: 1 to 28. For information about how to synchronize the expiration dates of instances, see Synchronize the expiration dates of instances. Note
The renewal period-related parameter pair ( Period and PeriodUnit ) and the ExpectedRenewDay parameter are mutually exclusive.
| 5 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"PriceInfo": {
"Rules": {
"Rule": [
{
"Description": "Receive a 15% discount on a 1-year subscription\n",
"RuleId": 1234567890
}
]
},
"Price": {
"OriginalPrice": 4368,
"DiscountPrice": 655.2,
"Currency": "CNY",
"TradePrice": 3712.8,
"DetailInfos": {
"ResourcePriceModel": [
{
"Resource": "instance",
"OriginalPrice": 4368,
"DiscountPrice": 655.2,
"TradePrice": 3712.8,
"SubRules": {
"Rule": [
{
"Description": "Receive a 15% discount on a 1-year subscription.\n",
"RuleId": 1234567890
}
]
}
}
]
}
}
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidResourceType.ValueNotSupported | The specified parameter ResourceType is not valid. | The specified resource type is not supported. |
400 | InvalidPeriod | The specified period is not valid. | The specified period is invalid. |
400 | InvalidPriceUnit.ValueNotSupported | The specified parameter PriceUnit is not valid. | The specified PriceUnit is invalid. |
400 | Throttling | Request was denied due to request throttling. | - |
400 | Throttling.User | Request was denied due to user flow control. | - |
400 | InternalError | The request processing has failed due to some unknown error. | An internal error has occurred. Try again later. |
400 | InvalidExpectedRenewDay.Conflict | The specified expectedRenewDay is in conflict with period. | - |
400 | InvalidExpectedRenewDay.Conflict | The specified expectedRenewDay is in conflict with priceUnit. | - |
400 | InvalidExpectedRenewDay.ValueNotSupported | The specified parameter ExpectedRenewDay is not valid. | - |
403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | The operation is not supported while the instance is using the current billing method. |
403 | InvalidAction.Unauthorized | The specified action is not valid. | The specified operation is invalid. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instance does not exist. |
500 | InternalError | %s | An internal error has occurred. |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error has occurred. Try again later. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|