All Products
Search
Document Center

Elastic Container Instance:DescribeAvailableResource

Last Updated:Oct 17, 2025

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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: Queries instance families. This value must be used with the Value parameter.

  • InstanceType: Queries instance types. This value must be used with the Value, Cores, and Memory parameters.

InstanceTypeFamily

Value

string

No

The instance family or a specific instance type.

  • If you set Category to InstanceTypeFamily, set this parameter to an instance family, such as ecs.c5.

  • If you set Category to InstanceType, set this parameter to a specific instance type, such as ecs.c5.large.

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:

  • NoSpot: a regular pay-as-you-go instance.

  • SpotWithPriceLimit: a spot instance for which you specify the maximum hourly price.

  • SpotAsPriceGo: a spot instance for which the system automatically bids based on the current market price.

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: instance family.

  • InstanceType: instance type.

InstanceTypeFamily

SupportedResources

object

SupportedResource

array<object>

An array of resource information.

object

Value

string

The information about the supported ECS instance type.

  • If Type is InstanceTypeFamily, this parameter returns an instance family.

  • If Type is InstanceType, this parameter returns an instance type.

ecs.c6

StatusCategory

string

The resource category based on inventory status. Valid values:

  • WithStock: The inventory is sufficient.

  • ClosedWithStock: The inventory is low. Select an instance type that is in the WithStock state.

  • WithoutStock: The inventory is sold out but will be replenished. Select an instance type that is in the WithStock state.

  • ClosedWithoutStock: The inventory is sold out and will not be replenished. Select an instance type that is in the WithStock state.

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.