Queries the Elastic Compute Service (ECS) instance families that are available in a specified region and zone.
Operation description
When you call the CreateContainerGroup operation to create an elastic container instance, you can use the InstanceType parameter to specify ECS instance types that fit your specific needs. To ensure that the elastic container instance can be created, you can call the DescribeAvailableResource operation to query which ECS instance types and instance families are available in the specified region and zone before you create the elastic container instance.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the ECS instance families. You can call the DescribeRegions operation to query the most recent list of regions. | cn-hangzhou |
ZoneId | string | No | The zone ID of the ECS instance families. This parameter is empty by default, which indicates that ECS instance families available in all zones in the specified region are queried. | cn-hangzhou-e |
DestinationResource | object | Yes | The information about the resource that you want to query. | |
Category | string | Yes | The type of the resource. Valid values:
| InstanceTypeFamily |
Value | string | No | Instance families or instance types.
| ecs.c6 |
Cores | float | No | The number of vCPUs. This parameter is available only when the Category parameter is set to InstanceType. | 2 |
Memory | float | No | The size of the memory. Unit: GiB. This parameter is available only when the Category parameter is set to InstanceType. | 4 |
SpotResource | object | No | The information about the preemptible instances that you want to query. | |
SpotStrategy | string | No | The bidding policy for the elastic container instance. Valid values:
Default value: NoSpot. Note
If you set this parameter to SpotWithPriceLimit or SpotAsPriceGo to query preemptible instances, you must set Category to InstanceType. You must also use the Value parameter to specify instance types, or use the Cores and Memory parameters to specify the number of vCPUs and memory size.
| SpotAsPriceGo |
SpotPriceLimit | double | No | The maximum hourly price of the preemptible elastic container instance. The value can be accurate to three decimal places. If you set SpotStrategy to SpotWithPriceLimit, you must specify the SpotPriceLimit parameter. | 0.2 |
SpotDuration | integer | No | The protection period of the preemptible instance. Unit: hours. Default value: 1. The value of 0 indicates no protection period. | 1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "6829735A-FF76-58C6-AECB-27CBF135A7AA",
"AvailableZones": {
"AvailableZone": [
{
"RegionId": "cn-hangzhou",
"ZoneId": "cn-hangzhou-e",
"AvailableResources": {
"AvailableResource": [
{
"Type": "InstanceTypeFamily",
"SupportedResources": {
"SupportedResource": [
{
"Value": "ecs.c6",
"StatusCategory": "WithStock"
}
]
}
}
]
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParameter | %s | - |
400 | InvalidParameter | %s | - |
403 | Spot.NotMatched | %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. | We recommend that you use the create multi-zone function to avoid insufficient inventory. |
404 | InvalidParameter.NotFound | %s | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-21 | The Error code has changed | View Change Details |