Queries the price of an Elastic Container Instance (ECI) instance.
Operation description
-
This operation does not support resource group-based authentication.
-
You can create an ECI instance by specifying the number of vCPUs and memory size, or by specifying an ECS instance type. When you call this operation to query prices, specify the supported specifications.
-
For more information, see vCPU and memory specifications.
-
For more information, see ECS instance types supported by ECI.
-
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eci:DescribeContainerGroupPrice |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the latest information about regions and zones. |
cn-hangzhou |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the latest information about regions and zones. |
cn-hangzhou |
| Cpu |
number |
No |
The number of vCPUs. For more information about the vCPU and memory specifications that are supported by ECI, see vCPU and memory specifications. |
2.0 |
| Memory |
number |
No |
The memory size. Unit: GiB. For more information about the vCPU and memory specifications that are supported by ECI, see vCPU and memory specifications. |
4.0 |
| InstanceType |
string |
No |
The ECS instance type. For more information about the ECS instance types that are supported by ECI, see ECS instance types supported by ECI. Note
If you set this parameter, the specified values for the Cpu and Memory parameters are ignored. The price of only the ECS instance type is returned. |
ecs.c5.large |
| SpotStrategy |
string |
No |
The preemption policy for the instance. Valid values:
Default value: NoSpot. |
SpotWithPriceLimit |
| ZoneId |
string |
No |
The zone ID. You can call DescribeRegions to query the latest information about regions and zones. |
cn-hangzhou-g |
| SpotPriceLimit |
number |
No |
The maximum hourly price of the spot instance. The value can be accurate to three decimal places. This parameter is required when SpotStrategy is set to SpotWithPriceLimit. |
0.2 |
| EphemeralStorage |
integer |
No |
The size of the temporary storage space. Unit: GiB. |
20 |
| SpotDuration |
integer |
No |
The protection period of the spot instance. Unit: hour. Default value: 1. A value of 0 indicates that no protection period is specified. |
1 |
| ComputeCategory |
string |
No |
The category of computing power. Set the value to `economy` to query the price of an economy instance type. |
economy |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
7A872585-33C7-4D69-AB8E-412E81EBA387 |
| PriceInfo |
object |
The price information, which includes the price and promotion rules. |
|
| SpotPrices |
object |
||
| SpotPrice |
array<object> |
The price information of the spot instance. |
|
|
object |
|||
| ZoneId |
string |
The zone ID. |
cn-hangzhou-i |
| SpotPrice |
number |
The price of the spot instance. |
0.056 |
| InstanceType |
string |
The instance type. |
ecs.c5.large |
| OriginPrice |
number |
The original price. |
0.622 |
| Price |
object |
The price. |
|
| DiscountPrice |
number |
The discounted price. |
0 |
| TradePrice |
number |
The final price, which is the original price minus the discount. |
0.00012252 |
| OriginalPrice |
number |
The original price. |
0.00012252 |
| DetailInfos |
object |
||
| DetailInfo |
array<object> |
The details of the price. |
|
|
array<object> |
|||
| Resource |
string |
The resource name. |
cpu |
| DiscountPrice |
number |
The discounted price. |
0 |
| TradePrice |
number |
The transaction price. |
0.000098 |
| OriginalPrice |
number |
The original price. |
0.000098 |
| Rules |
object |
||
| Rule |
array<object> |
The pricing rules. |
|
|
object |
|||
| Description |
string |
The description of the rule. |
***** |
| RuleId |
integer |
The rule ID. |
123456 |
| Currency |
string |
The currency. Valid values:
|
CNY |
| Rules |
object |
||
| Rule |
array<object> |
The promotion rules. |
|
|
object |
|||
| Description |
string |
The description of the promotion rule. |
***** |
| RuleId |
integer |
The promotion ID. |
123456 |
Examples
Success response
JSON format
{
"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
}
]
}
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParam.CpuOrMemorySpec | The specified specification is invalid. | The specified specification is invalid. |
| 400 | TradeBidCommodityNotMatch | The trade ID and the commodity do not match. | |
| 400 | InvalidSpotCpuMemorySpec | The specified CPU and memory are not allowed. You must create spot ECI using standard ECS specifications for CPU and memory. | |
| 400 | FeatureBasedConstraintConflict | A conflict occurs in specified feature constraints: [%s]. | A conflict occurs in specified feature constraints |
| 403 | Spot.NotMatched | %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://www.alibabacloud.com/help/document_detail/157290.html | |
| 403 | FeatureAccessRestricted | Access to this feature:[%s] is restricted. Please contact Alibaba Cloud ECI support to request access. | Access to this feature is restricted. Please contact Alibaba Cloud ECI support to request access. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.