查询ECI实例的价格。
接口说明
本接口不支持资源组鉴权。
- ECI 实例支持指定 vCPU 和内存,或者指定 ECS 规格创建。调用本接口查询价格时,请传入 ECI 支持指定的规格。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
eci:DescribeContainerGroupPrice |
get |
*全部资源
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
RegionId |
string |
是 |
地域 ID。您可以调用 DescribeRegions 查询最新的地域可用区信息。 |
cn-hangzhou |
RegionId |
string |
是 |
地域 ID。您可以调用 DescribeRegions 查询最新的地域可用区信息。 |
cn-hangzhou |
Cpu |
number |
否 |
vCPU 大小。ECI 支持的 vCPU 和内存规格请参见 vCPU 和内存规格说明。 |
2.0 |
Memory |
number |
否 |
内存大小。单位为 GiB。ECI 支持的 vCPU 和内存规格请参见 vCPU 和内存规格说明。 |
4.0 |
InstanceType |
string |
否 |
指定的 ECS 实例规格。ECI 支持指定的 ECS 规格请参见ECI 支持的 ECS 规格说明。 说明
设置该参数后,将自动忽略传入的 vCPU 和内存值,仅返回 ECS 规格的价格信息。 |
ecs.c5.large |
SpotStrategy |
string |
否 |
实例的抢占策略。取值范围:
默认为:NoSpot。 |
SpotWithPriceLimit |
ZoneId |
string |
否 |
可用区。您可以调用 DescribeRegions 查询最新的地域可用区信息。 |
cn-hangzhou-g |
SpotPriceLimit |
number |
否 |
设置抢占式实例的每小时最高价格,最多精确到小数点后 3 位。当 SpotStrategy 取值为 SpotWithPriceLimit 时,必须设置 SpotPriceLimit。 |
0.2 |
EphemeralStorage |
integer |
否 |
临时存储空间大小。单位为 GiB.。 |
20 |
SpotDuration |
integer |
否 |
抢占式实例的保护期。单位为小时。默认为 1。可设置为 0,表示无保护期。 |
1 |
ComputeCategory |
string |
否 |
算力类别。取值为 economy 时,表示查询经济型规格的价格。 |
economy |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
|||
RequestId |
string |
请求 ID,唯一标识。 |
7A872585-33C7-4D69-AB8E-412E81EBA387 |
PriceInfo |
object |
价格信息类型(Price),包括价格和优惠规则。 |
|
SpotPrices |
object |
||
SpotPrice |
array<object> |
抢占式实例价格信息。 |
|
object |
|||
ZoneId |
string |
可用区。 |
cn-hangzhou-i |
SpotPrice |
number |
抢占式实例的价格。 |
0.056 |
InstanceType |
string |
实例规格。 |
ecs.c5.large |
OriginPrice |
number |
原价。 |
0.622 |
Price |
object |
价格。 |
|
DiscountPrice |
number |
折扣价。 |
0 |
TradePrice |
number |
最终价,为原价减去折扣。 |
0.00012252 |
OriginalPrice |
number |
原价。 |
0.00012252 |
DetailInfos |
object |
||
DetailInfo |
array<object> |
价格的详细信息。 |
|
object |
|||
Resource |
string |
资源名称。 |
cpu |
DiscountPrice |
number |
折扣价。 |
0 |
TradePrice |
number |
成交价。 |
0.000098 |
OriginalPrice |
number |
原价。 |
0.000098 |
Rules |
object |
||
Rule |
array<object> |
定价规则子集。 |
|
object |
|||
Description |
string |
规则描述。 |
***** |
RuleId |
integer |
规则 ID。 |
123456 |
Currency |
string |
货币单位。可能值:
|
CNY |
Rules |
object |
||
Rule |
array<object> |
活动规则。 |
|
object |
|||
Description |
string |
活动规则描述。 |
***** |
RuleId |
integer |
活动 ID。 |
123456 |
示例
正常返回示例
JSON
格式
{
"RequestId": "7A872585-33C7-4D69-AB8E-412E81EBA387",
"PriceInfo": {
"SpotPrices": {
"SpotPrice": [
{
"ZoneId": "cn-hangzhou-i",
"SpotPrice": 0.056,
"InstanceType": "ecs.c5.large",
"OriginPrice": 0.622
}
]
},
"Price": {
"DiscountPrice": 0,
"TradePrice": 0.00012252,
"OriginalPrice": 0.00012252,
"DetailInfos": {
"DetailInfo": [
{
"Resource": "cpu",
"DiscountPrice": 0,
"TradePrice": 0.000098,
"OriginalPrice": 0.000098,
"Rules": {
"Rule": [
{
"Description": "*****",
"RuleId": 123456
}
]
}
}
]
},
"Currency": "CNY"
},
"Rules": {
"Rule": [
{
"Description": "*****",
"RuleId": 123456
}
]
}
}
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
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。 |
400 | FeatureBasedConstraintConflict | A conflict occurs in specified feature constraints: [%s]. | 指定的规格特性约束发生冲突 |
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 | |
403 | FeatureAccessRestricted | Access to this feature:[%s] is restricted. Please contact Alibaba Cloud ECI support to request access. | 使用该特性需要申请白名单,请联系阿里云ECI团队申请加白。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。