您可以调用QueryConvertInstancePrice查询转换工作空间时的价格。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | QueryConvertInstancePrice |
系统规定参数。取值:QueryConvertInstancePrice。 |
ConvertPostpayInstanceRequest | Object | 是 |
查询转换工作空间时所需的请求参数。 |
|
Region | String | 是 | cn-beijing |
工作空间所属的地域ID。 |
InstanceId | String | 是 | sc_flinkserverlesspost_public_cn-****** |
工作空间ID。 |
PricingCycle | String | 是 | Month |
订购周期。取值支持Day、Month、Year。 |
Duration | Integer | 是 | 1 |
订购周期数量。 |
IsAutoRenew | Boolean | 是 | true |
是否自动续费,取值如下:
|
NamespaceResourceSpecs | Array | 是 |
项目空间资源规格信息。 |
|
Namespace | String | 是 | ns-1 |
项目空间名称。 |
ResourceSpec | Object | 是 |
资源规格。 |
|
Cpu | Integer | 是 | 1 |
CPU数量。 |
MemoryGB | Integer | 是 | 4 |
内存大小。单位:GB。 说明 内存大小必须为CPU数量大小的4倍。
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 67F33190-946B-1105-B6A1-E2DF0426DD51 |
请求ID。 |
Success | Boolean | true |
查询是否成功,取值如下:
|
PriceInfo | Object |
价格信息,包括价格和优惠规则。 |
|
Currency | String | CNY |
货币单位。 |
DiscountAmount | Float | 655.2 |
折扣金额。 |
OriginalAmount | Float | 4368 |
原价。 |
TradeAmount | Float | 3712.8 |
最终价,为原价减去折扣金额。 |
Code | String | ORDER.INST_HAS_UNPAID_ORDER |
错误码。 |
Message | String | 存在未支付订单,请先支付或取消原有订单。 |
错误信息。 |
OptionalPromotions | Array of OptionalPromotion |
优惠券信息。 |
|
PromotionDesc | String | ¥1,391.5优惠券 (有效期至 03/23/2022) |
优惠券描述。 |
PromotionName | String | ¥1,391.5优惠券 |
优惠券名称。 |
PromotionOptionNo | String | 500011220010099 |
优惠券编号。 |
Selected | Boolean | true |
是否选用优惠券,取值如下:
|
Rules | Array of Rule |
活动规则。 |
|
Description | String | 买满1年,立享官网价格8.5折优惠。 |
活动规则描述。 |
RuleId | Long | 1020071005141834 |
活动ID。 |
示例
请求示例
http(s)://{Endpoint}/?Action=QueryConvertInstancePrice
&ConvertPostpayInstanceRequest={"Region":"cn-beijing","InstanceId":"sc_flinkserverlesspost_public_cn-******","PricingCycle":"Month","Duration":1,"IsAutoRenew":true,"NamespaceResourceSpecs":[{"Namespace":"ns-1","ResourceSpec":{"Cpu":1,"MemoryGB":4}}]}
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<QueryConvertInstancePriceResponse>
<RequestId>67F33190-946B-1105-B6A1-E2DF0426DD51</RequestId>
<Success>true</Success>
<PriceInfo>
<Currency>CNY</Currency>
<DiscountAmount>655.2</DiscountAmount>
<OriginalAmount>4368</OriginalAmount>
<TradeAmount>3712.8</TradeAmount>
<Code>ORDER.INST_HAS_UNPAID_ORDER</Code>
<Message>存在未支付订单,请先支付或取消原有订单。</Message>
<OptionalPromotions>
<PromotionDesc>¥1,391.5优惠券 (有效期至 03/23/2022)</PromotionDesc>
<PromotionName>¥1,391.5优惠券</PromotionName>
<PromotionOptionNo>500011220010099</PromotionOptionNo>
<Selected>true</Selected>
</OptionalPromotions>
<Rules>
<Description>买满1年,立享官网价格8.5折优惠。</Description>
<RuleId>1020071005141834</RuleId>
</Rules>
</PriceInfo>
</QueryConvertInstancePriceResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "67F33190-946B-1105-B6A1-E2DF0426DD51",
"Success" : true,
"PriceInfo" : {
"Currency" : "CNY",
"DiscountAmount" : 655.2,
"OriginalAmount" : 4368,
"TradeAmount" : 3712.8,
"Code" : "ORDER.INST_HAS_UNPAID_ORDER",
"Message" : "存在未支付订单,请先支付或取消原有订单。",
"OptionalPromotions" : [ {
"PromotionDesc" : "¥1,391.5优惠券 (有效期至 03/23/2022)",
"PromotionName" : "¥1,391.5优惠券",
"PromotionOptionNo" : "500011220010099",
"Selected" : true
} ],
"Rules" : [ {
"Description" : "买满1年,立享官网价格8.5折优惠。",
"RuleId" : 1020071005141834
} ]
}
}