Queries the ECS instance families available for sale in a specified region and zone.
Operation description
When you call CreateContainerGroup to create an Elastic Container Instance (ECI) instance, you can use the InstanceType parameter to specify an ECS instance type to meet specific requirements. To ensure that the ECI instance can be created successfully, call this operation to query the ECS instance types or instance families supported in a specified region and zone before creating the ECI instance.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| ZoneId |
string |
No |
The zone ID. Default value: empty. If this parameter is left empty, all zones in the specified region are queried. |
cn-hangzhou-e |
| DestinationResource |
object |
Yes |
The resource information to query. |
|
| Category |
string |
Yes |
The resource type. Valid values:
|
InstanceTypeFamily |
| Value |
string |
No |
The instance family or specific instance type.
|
ecs.c6 |
| Cores |
number |
No |
The number of vCPUs. This parameter can be specified when Category is set to InstanceType. |
2 |
| Memory |
number |
No |
The memory size. Unit: GiB. This parameter can be specified when Category is set to InstanceType. |
4 |
| RegionId |
string |
Yes |
The resource information of the spot instance to query. |
cn-hangzhou |
| SpotResource |
object |
No |
The information about the spot instance resource to query. |
|
| SpotStrategy |
string |
No |
The preemption policy for the instance. Valid values:
Default value: NoSpot. Note
When you query information about a spot instance resource, if you set this parameter to SpotWithPriceLimit or SpotAsPriceGo, you must set Category to InstanceType. You must also specify an instance type using the Value parameter, or specify the number of vCPUs and memory size using the Cores and Memory parameters. |
SpotAsPriceGo |
| SpotPriceLimit |
number |
No |
The maximum hourly price of the spot instance. The value can have up to three decimal places. This parameter is required only when SpotStrategy is set to SpotWithPriceLimit. |
0.2 |
| SpotDuration |
integer |
No |
The protection period of the spot instance, in hours. The default value is 1. Set the value to 0 to specify no protection period. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
6829735A-FF76-58C6-AECB-27CBF135A7AA |
| AvailableZones |
object |
||
| AvailableZone |
array<object> |
The collection of resource information at the zone level. |
|
|
array<object> |
|||
| RegionId |
string |
The region ID. |
cn-hangzhou |
| ZoneId |
string |
The zone ID. |
cn-hangzhou-e |
| AvailableResources |
object |
||
| AvailableResource |
array<object> |
The collection of resource information supported in the zone. |
|
|
array<object> |
|||
| Type |
string |
The resource type. Valid values:
|
InstanceTypeFamily |
| SupportedResources |
object |
||
| SupportedResource |
array<object> |
The array of resource information. |
|
|
object |
|||
| Value |
string |
The supported ECS instance type information.
|
ecs.c6 |
| StatusCategory |
string |
The resource category based on detailed inventory classification. Valid values:
|
WithStock |
Examples
Success response
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 | Required parameters are missing. |
| 400 | InvalidParameter | %s | The parameter is invalid. |
| 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 | The parameter was not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.