All Products
Search
Document Center

Elastic Compute Service:DescribeRenewalPrice

Last Updated:Nov 14, 2024

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 and PeriodUnit) 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeRenewalPriceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the instance. You can call the DescribeRegions operation to query the most recent list of regions.

cn-hangzhou
ResourceTypestringNo

The type of the resource. Set the value to instance.

Default value: instance.

instance
ResourceIdstringYes

The ID of the resource. If the ResourceType parameter is set to instance, the value of the ResourceId parameter is the ID of the specified instance.``

i-bp1f2o4ldh8l29zv****
PeriodintegerNo

The renewal period. Valid values:

  • Valid values when the PriceUnit parameter is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, and 9.
  • Valid values when the PriceUnit parameter is set to Year: 1, 2, 3.

Default value: 1.

Note The renewal period-related parameter pair (Period and PeriodUnit) and the ExpectedRenewDay parameter are mutually exclusive.
1
PriceUnitstringNo

The unit of the renewal period. Valid values:

  • Month
  • Year

Default value: Month.

Month
ExpectedRenewDayintegerNo

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

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
PriceInfoobject

Details about the prices and promotion rules.

Rulesarray<object>

Details about the promotion rules.

Ruleobject
Descriptionstring

The description of the promotion rule.

Receive a 15% discount on a 1-year subscription
RuleIdlong

The ID of the promotion rule.

1234567890
Priceobject

The price.

OriginalPricefloat

The original price.

4368
DiscountPricefloat

The discount.

655.2
Currencystring

The currency unit.

Alibaba Cloud China site (aliyun.com): CNY.

Alibaba Cloud International site (alibabacloud.com): USD.

CNY
TradePricefloat

The transaction price, which is equal to the original price minus the discount.

3712.8
DetailInfosarray<object>

Details about the resource prices.

ResourcePriceModelobject
Resourcestring

The name of the resource that corresponds to the price.

instance
OriginalPricefloat

The original price.

4368
DiscountPricefloat

The discount.

655.2
TradePricefloat

The transaction price.

3712.8
SubRulesarray<object>

The pricing rules.

Ruleobject
Descriptionstring

The description of the pricing rule.

Receive a 15% discount on a 1-year subscription.
RuleIdlong

The ID of the pricing rule.

1234567890

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidResourceType.ValueNotSupportedThe specified parameter ResourceType is not valid.The specified resource type is not supported.
400InvalidPeriodThe specified period is not valid.The specified period is invalid.
400InvalidPriceUnit.ValueNotSupportedThe specified parameter PriceUnit is not valid.The specified PriceUnit is invalid.
400ThrottlingRequest was denied due to request throttling.-
400Throttling.UserRequest was denied due to user flow control.-
400InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.
400InvalidExpectedRenewDay.ConflictThe specified expectedRenewDay is in conflict with period.-
400InvalidExpectedRenewDay.ConflictThe specified expectedRenewDay is in conflict with priceUnit.-
400InvalidExpectedRenewDay.ValueNotSupportedThe specified parameter ExpectedRenewDay is not valid.-
403ChargeTypeViolationThe 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.
403InvalidAction.UnauthorizedThe specified action is not valid.The specified operation is invalid.
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.
500InternalError%sAn internal error has occurred.
500InternalErrorThe 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 timeSummary of changesOperation
No change history