Queries the price of an elastic container instance.
Operation description
-
When you call this operation, you cannot use resource groups to control the permissions of a RAM user.
-
You can create an elastic container instance by specifying vCPU and memory resource specifications or by specifying ECS instance types. When you call this operation to query the prices of elastic container instances, pass in specifications of the elastic container instances.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the instance. You can call the DescribeRegions operation to query the most recent region and zone list. | cn-hangzhou |
Cpu | float | Yes | The number of vCPUs. For information about the vCPU and memory specifications that are supported by Elastic Container Instance, see vCPU and memory specifications. | 2.0 |
Memory | float | Yes | The size of the memory. Unit: GiB. For information about the vCPU and memory specifications that are supported by Elastic Container Instance, see vCPU and memory specifications. | 4.0 |
InstanceType | string | No | The instance type of the Elastic Compute Service (ECS) instance that is used to create the elastic container instance. For information about the ECS instance types that are supported by Elastic Container Instance, see ECS instance types that are supported by Elastic Container Instance. Note
If you specify this parameter, the specified specifications of vCPUs and memory are ignored. Only the price of the ECS instance type is returned.
| ecs.c5.large |
SpotStrategy | string | No | The bidding policy for the elastic container instance. Valid values:
Default value: NoSpot. | SpotWithPriceLimit |
ZoneId | string | No | The zone ID of the instance. You can call the DescribeRegions operation to query the most recent region and zone list. | cn-hangzhou-g |
SpotPriceLimit | float | No | The maximum hourly price of the preemptible elastic container instance. The value can contain up to three decimal places. If you set SpotStrategy to SpotWithPriceLimit, you must specify SpotPriceLimit. | 0.2 |
EphemeralStorage | integer | No | The storage size of the temporary storage space. Unit: GiB. | 20 |
SpotDuration | integer | No | The protection period of the preemptible instance. Unit: hours. Default value: 1. The value of 0 indicates no protection period. | 1 |
ComputeCategory | string | No | The computing power type. A value of economy specifies economic instances. | economy |
Response parameters
Examples
Sample success responses
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": "Receive a 15% discount on a 1-year subscription\n",
"RuleId": 123456
}
]
}
}
]
},
"Currency": "CNY"
},
"Rules": {
"Rule": [
{
"Description": "Receive a 15% discount on a 1-year subscription\n",
"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://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. | Access to this feature is restricted. Please contact Alibaba Cloud ECI support to request access. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-12-27 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-12-25 | The Error code has changed | View Change Details |