调用DescribeRenewalPrice查询云服务器ECS资源的续费价格。仅支持查询包年包月资源的续费价格。
接口说明
- 仅支持查询包年包月ECS实例续费时长的价格或者续费至统一到期日的价格。
- 参数设置的注意事项如下:
- 只设置必选参数时,默认查询实例续费时长1个月的价格信息。
- 不支持同时查询续费时长价格和续费至统一到期日的价格,即续费时长参数(
Period
、PeriodUnit
)与续费至统一到期日参数(ExpectedRenewDay
)不能同时设置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeRenewalPrice |
系统规定参数。取值:DescribeRenewalPrice。 |
RegionId | String | 是 | cn-hangzhou |
实例所属的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 |
ResourceType | String | 否 | instance |
查询续费价格的资源类型。取值:instance。 默认值:instance。 |
ResourceId | String | 是 | i-bp1f2o4ldh8l29zv**** |
查询续费价格的资源ID。参数 |
Period | Integer | 否 | 1 |
指定续费时长。取值范围:
默认值:1。 说明 续费时长参数(
Period 、PeriodUnit )与统一到期日参数(ExpectedRenewDay )不能同时设置。
|
PriceUnit | String | 否 | Month |
指定续费周期。取值范围:
默认值:Month。 |
ExpectedRenewDay | Integer | 否 | 5 |
统一到期日。指定该参数后,将查询实例续费至统一到期日的价格信息。取值范围:1~28。 关于统一到期日功能的更多信息,请参见统一实例到期日。 说明 续费时长参数(
Period 、PeriodUnit )与统一到期日参数(ExpectedRenewDay )不能同时设置。
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
请求ID。 |
PriceInfo | Object |
价格信息类型(PriceInfo)组成的数据类型,包括价格和优惠规则信息。 |
|
Rules | Array of Rule |
活动规则。 |
|
Rule | |||
Description | String | 买满1年,立享官网价格8.5折优惠。 |
活动规则描述。 |
RuleId | Long | 1234567890 |
活动ID。 |
Price | Object |
价格。 |
|
OriginalPrice | Float | 4368 |
原价。 |
DiscountPrice | Float | 655.2 |
折扣。 |
Currency | String | CNY |
货币单位。 中国站:CNY。 国际站:USD。 |
TradePrice | Float | 3712.8 |
最终价,为原价减去折扣。 |
DetailInfos | Array of ResourcePriceModel |
资源定价详情。 |
|
ResourcePriceModel | |||
Resource | String | instance |
价格对应的资源名称。 |
OriginalPrice | Float | 4368 |
原价。 |
DiscountPrice | Float | 655.2 |
折扣价。 |
TradePrice | Float | 3712.8 |
成交价。 |
SubRules | Array of Rule |
定价规则子集。 |
|
Rule | |||
Description | String | 买满1年,立享官网价格8.5折优惠。 |
定价规则描述。 |
RuleId | Long | 1234567890 |
定价规则ID。 |
示例
请求示例
http(s)://ecs.aliyuncs.com/?Action=DescribeRenewalPrice
&RegionId=cn-hangzhou
&ResourceType=instance
&ResourceId=i-bp1f2o4ldh8l29zv****
&Period=1
&PriceUnit=Month
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeRenewalPriceResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
<PriceInfo>
<Rules>
<Rule>
<Description>买满1年,立享官网价格8.5折优惠。</Description>
<RuleId>1234567890</RuleId>
</Rule>
</Rules>
</PriceInfo>
<Price>
<OriginalPrice>4368</OriginalPrice>
<DiscountPrice>655.2</DiscountPrice>
<Currency>CNY</Currency>
<TradePrice>3712.8</TradePrice>
<DetailInfos>
<DetailInfo>
<Resource>instance</Resource>
<OriginalPrice>4368</OriginalPrice>
<DiscountPrice>655.2</DiscountPrice>
<TradePrice>3712.8</TradePrice>
<SubRules>
<SubRule>
<Description>买满1年,立享官网价格8.5折优惠。</Description>
<RuleId>1234567890</RuleId>
</SubRule>
</SubRules>
</DetailInfo>
</DetailInfos>
</Price>
</DescribeRenewalPriceResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/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" : {
"DetailInfo" : [ {
"Resource" : "instance",
"OriginalPrice" : 4368,
"DiscountPrice" : 655.2,
"TradePrice" : 3712.8,
"SubRules" : {
"SubRule" : [ {
"Description" : "买满1年,立享官网价格8.5折优惠。",
"RuleId" : 1234567890
} ]
}
} ]
}
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidResourceType.ValueNotSupported | The specified parameter ResourceType is not valid. | 指定的资源类型不合法。 |
400 | InvalidPeriod | The specified period is not valid. | 指定的时段不合法。 |
400 | InvalidPriceUnit.ValueNotSupported | The specified parameter PriceUnit is not valid. | 指定的单价不合法。 |
400 | Throttling | Request was denied due to request throttling. | 当前的操作太过频繁,请稍后重试。 |
400 | InternalError | The request processing has failed due to some unknown error. | 内部错误,请重试。 |
500 | InternalError | %s | 内部错误。 |
403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | 付费方式不支持该操作,请您检查实例的付费类型是否与该操作冲突。 |
403 | InvalidAction.Unauthorized | The specified action is not valid. | 指定的操作无效。 |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的实例不存在,请您检查实例ID是否正确。 |
访问错误中心查看更多错误码。