You can call the DescribeAvailableResource operation to query the ECS instance families that are available in a specified region and zone.
Operation description
When you call the CreateContainerGroup operation to create an ECI instance, you can use the InstanceType parameter to specify an ECS instance type to meet specific requirements. To ensure that the ECI instance is created successfully, first call this operation to query the supported ECS instance types or instance families in a specific region and zone.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. Call DescribeRegions to view the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| ZoneId |
string |
No |
The zone ID. If you do not specify this parameter, all zones in the specified region are queried. |
cn-hangzhou-e |
| DestinationResource |
object |
Yes |
The information about the resource to query. |
|
| Category |
string |
Yes |
The resource type. Valid values:
|
InstanceTypeFamily |
| Value |
string |
No |
The instance family or a specific instance type.
|
ecs.c6 |
| Cores |
number |
No |
The number of vCPUs. You can set this parameter only when Category is set to InstanceType. |
2 |
| Memory |
number |
No |
The memory size, in GiB. You can set this parameter only when Category is set to InstanceType. |
4 |
| RegionId |
string |
Yes |
The region ID. Call DescribeRegions to view the latest list of Alibaba Cloud regions. |
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 |
Response schema |
||
| RequestId |
string |
The request ID. |
6829735A-FF76-58C6-AECB-27CBF135A7AA |
| AvailableZones |
object |
||
| AvailableZone |
array<object> |
A collection of resource information for the zone. |
|
|
array<object> |
|||
| RegionId |
string |
The region ID. |
cn-hangzhou |
| ZoneId |
string |
The zone ID. |
cn-hangzhou-e |
| AvailableResources |
object |
||
| AvailableResource |
array<object> |
A collection of information about the resources that are supported in the zone. |
|
|
array<object> |
|||
| Type |
string |
The resource type. Valid values:
|
InstanceTypeFamily |
| SupportedResources |
object |
||
| SupportedResource |
array<object> |
An array of resource information. |
|
|
object |
|||
| Value |
string |
The information about the supported ECS instance type.
|
ecs.c6 |
| StatusCategory |
string |
The resource category based on inventory status. 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 | |
| 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 |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.