调用DescribeContainerGroupPrice查询实例的价格。
接口说明
- 本接口不支持资源组鉴权。
- ECI实例支持指定vCPU和内存,或者指定ECS规格创建。调用本接口查询价格时,请传入ECI支持指定的规格。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeContainerGroupPrice | 系统规定参数。取值:DescribeContainerGroupPrice。 |
RegionId | String | 是 | cn-hangzhou | 地域ID。您可以调用DescribeRegions查询最新的地域可用区信息。 |
Cpu | Float | 是 | 2.0 | vCPU大小。ECI支持的vCPU和内存规格请参见vCPU和内存规格说明。 |
Memory | Float | 是 | 4.0 | 内存大小。单位为GiB。ECI支持的vCPU和内存规格请参见vCPU和内存规格说明。 |
InstanceType | String | 否 | ecs.c5.large | 指定的ECS实例规格。ECI支持指定的ECS规格请参见ECI支持的ECS规格说明。
说明 设置该参数后,将自动忽略传入的vCPU和内存值,仅返回ECS规格的价格信息。
|
SpotStrategy | String | 否 | SpotWithPriceLimit | 实例的抢占策略。取值范围:
默认为:NoSpot。 |
ZoneId | String | 否 | cn-hangzhou-g | 可用区。您可以调用DescribeRegions查询最新的地域可用区信息。 |
SpotPriceLimit | Float | 否 | 0.2 | 设置抢占式实例的每小时最高价格,最多精确到小数点后3位。当SpotStrategy取值为SpotWithPriceLimit时,必须设置SpotPriceLimit。 |
EphemeralStorage | Integer | 否 | 20 | 临时存储空间大小。单位为GiB.。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 7A872585-33C7-4D69-AB8E-412E81EBA387 | 请求ID,唯一标识。 |
PriceInfo | Object | 价格信息类型(Price),包括价格和优惠规则。 |
|
SpotPrices | Array of SpotPrice | 抢占式实例价格信息。 |
|
SpotPrice | |||
ZoneId | String | cn-hangzhou-i | 可用区。 |
SpotPrice | Float | 0.056 | 抢占式实例的价格。 |
InstanceType | String | ecs.c5.large | 实例规格。 |
OriginPrice | Float | 0.622 | 原价。 |
Price | Object | 价格。 |
|
DiscountPrice | Float | 0 | 折扣价。 |
TradePrice | Float | 0.00012252 | 最终价,为原价减去折扣。 |
OriginalPrice | Float | 0.00012252 | 原价。 |
DetailInfos | Array of DetailInfo | 价格的详细信息。 |
|
DetailInfo | |||
Resource | String | cpu | 资源名称。 |
DiscountPrice | Float | 0 | 折扣价。 |
TradePrice | Float | 0.000098 | 成交价。 |
OriginalPrice | Float | 0.000098 | 原价。 |
Rules | Array of Rule | 定价规则子集。 |
|
Rule | |||
Description | String | 买满1年,立享官网价格8.5折优惠 | 规则描述。 |
RuleId | Long | 123456 | 规则ID。 |
Currency | String | CNY | 货币单位。可能值:
|
Rules | Array of Rule | 活动规则。 |
|
Rule | |||
Description | String | 买满1年,立享官网价格8.5折优惠 | 活动规则描述。 |
RuleId | Long | 123456 | 活动ID。 |
示例
请求示例
https://eci.aliyuncs.com/?Action=DescribeContainerGroupPrice
&Cpu=2.0
&Memory=4.0
&RegionId=cn-hangzhou
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeContainerGroupPriceResponse>
<RequestId>49BF254A-F5A6-5B71-9F2B-5DB61B4FE12B</RequestId>
<PriceInfo>
<Price>
<OriginalPrice>0.00017222</OriginalPrice>
<Currency>CNY</Currency>
<DiscountPrice>0.00016949</DiscountPrice>
<DetailInfos>
<DetailInfo>
<OriginalPrice>0.00017222</OriginalPrice>
<DiscountPrice>0.00016949</DiscountPrice>
<Resource>instance_type</Resource>
<TradePrice>0.00000273</TradePrice>
<Rules>
</Rules>
</DetailInfo>
</DetailInfos>
<TradePrice>0.00000273</TradePrice>
</Price>
<Rules>
<Rule>
<Description>买满1年,立享官网价格8.5折优惠</Description>
<RuleId>123456</RuleId>
</Rule>
</Rules>
</PriceInfo>
</DescribeContainerGroupPriceResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "49BF254A-F5A6-5B71-9F2B-5DB61B4FE12B",
"PriceInfo" : {
"Price" : {
"OriginalPrice" : 1.7222E-4,
"Currency" : "CNY",
"DiscountPrice" : 1.6949E-4,
"DetailInfos" : {
"DetailInfo" : [ {
"OriginalPrice" : 1.7222E-4,
"DiscountPrice" : 1.6949E-4,
"Resource" : "instance_type",
"TradePrice" : 2.73E-6,
"Rules" : {
"Rule" : [ ]
}
} ]
},
"TradePrice" : 2.73E-6
},
"Rules" : {
"Rule" : [ {
"Description" : "买满1年,立享官网价格8.5折优惠",
"RuleId" : 123456
} ]
}
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParam.CpuOrMemorySpec | The specified specification is invalid. | 指定的规格还未开放售卖,不提供价格查询。 |
400 | TradeBidCommodityNotMatch | The trade ID and the commodity do not match. | 交易的业务ID和商品不匹配。 |
400 | InvalidSpotCpuMemorySpec | The specified CPU and memory are not allowed. You must create spot ECI using standard ECS specifications for CPU and memory. | 必须采用标准的ECS规格来创建ECI spot。 |
403 | Spot.NotMatched | %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://help.aliyun.com/document_detail/157290.html | %s. 推荐使用多可用区多规格配置来避免库存不足,更多信息见:https://help.aliyun.com/document_detail/157290.html |
访问错误中心查看更多错误码。