文档

DescribeRenewalPrice - 查询资源续费价格

更新时间:

调用DescribeRenewalPrice查询云服务器ECS资源的续费价格。仅支持查询包年包月资源的续费价格。

接口说明

  • 仅支持查询包年包月 ECS 实例续费时长的价格或者续费至统一到期日的价格。
  • 参数设置的注意事项如下:
    • 只设置必选参数时,默认查询实例续费时长 1 个月的价格信息。
    • 不支持同时查询续费时长价格和续费至统一到期日的价格,即续费时长参数(PeriodPeriodUnit)与续费至统一到期日参数(ExpectedRenewDay)不能同时设置。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ecs:DescribeRenewalPriceREAD
  • 全部资源
    *
  • ecs:tag

请求参数

名称类型必填描述示例值
RegionIdstring

实例所属的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-hangzhou
ResourceTypestring

查询续费价格的资源类型。取值:instance。

默认值:instance。

instance
ResourceIdstring

查询续费价格的资源 ID。参数ResourceType取值为instance时,ResourceId可以理解为InstanceId

i-bp1f2o4ldh8l29zv****
Periodinteger

指定续费时长。取值范围:

  • 当参数PriceUnit取值为Month时:1~9。
  • 当参数PriceUnit取值为Year时:1~3。

默认值:1。

说明 续费时长参数(PeriodPeriodUnit)与统一到期日参数(ExpectedRenewDay)不能同时设置。
1
PriceUnitstring

指定续费周期。取值范围:

  • Month:续费周期为一个月。
  • Year:续费周期为一年。

默认值:Month。

Month
ExpectedRenewDayinteger

统一到期日。指定该参数后,将查询实例续费至统一到期日的价格信息。取值范围:1~28。

关于统一到期日功能的更多信息,请参见统一实例到期日

说明 续费时长参数(PeriodPeriodUnit)与统一到期日参数(ExpectedRenewDay)不能同时设置。
5

返回参数

名称类型描述示例值
object
RequestIdstring

请求 ID。

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

价格信息类型(PriceInfo)组成的数据类型,包括价格和优惠规则信息。

Rulesobject []

活动规则。

Descriptionstring

活动规则描述。

买满1年,立享官网价格8.5折优惠。
RuleIdlong

活动 ID。

1234567890
Priceobject

价格。

OriginalPricefloat

原价。

4368
DiscountPricefloat

折扣。

655.2
Currencystring

货币单位。

中国站:CNY。

国际站:USD。

CNY
TradePricefloat

最终价,为原价减去折扣。

3712.8
DetailInfosobject []

资源定价详情。

Resourcestring

价格对应的资源名称。

instance
OriginalPricefloat

原价。

4368
DiscountPricefloat

折扣价。

655.2
TradePricefloat

成交价。

3712.8
SubRulesobject []

定价规则子集。

Descriptionstring

定价规则描述。

买满1年,立享官网价格8.5折优惠。
RuleIdlong

定价规则 ID。

1234567890

示例

正常返回示例

JSON格式

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PriceInfo": {
    "Rules": {
      "Rule": [
        {
          "Description": "买满1年,立享官网价格8.5折优惠。",
          "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": "买满1年,立享官网价格8.5折优惠。",
                  "RuleId": 1234567890
                }
              ]
            }
          }
        ]
      }
    }
  }
}

错误码

HTTP status code错误码错误信息描述
400InvalidResourceType.ValueNotSupportedThe specified parameter ResourceType is not valid.指定的资源类型不合法。
400InvalidPeriodThe specified period is not valid.指定的时段不合法。
400InvalidPriceUnit.ValueNotSupportedThe specified parameter PriceUnit is not valid.指定的单价不合法。
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.内部错误,请重试。
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.付费方式不支持该操作,请您检查实例的付费类型是否与该操作冲突。
403InvalidAction.UnauthorizedThe specified action is not valid.指定的操作无效。
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.指定的实例ID未找到。
500InternalError%s内部错误。
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.内部错误,请重试。

访问错误中心查看更多错误码。

  • 本页导读 (1)
文档反馈