All Products
Search
Document Center

Elastic Container Instance:DescribeAvailableResource

Last Updated:Aug 28, 2026

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

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.

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: queries instance families. Use this value together with Value.

  • InstanceType: queries instance types. Use this value together with Value, Cores, and Memory.

InstanceTypeFamily

Value

string

No

The instance family or specific instance type.

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

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

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:

  • 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

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

  • InstanceType: instance type.

InstanceTypeFamily

SupportedResources

object

SupportedResource

array<object>

The array of resource information.

object

Value

string

The supported ECS instance type information.

  • If Type is InstanceTypeFamily, the value is an instance family.

  • If Type is InstanceType, the value is an instance type.

ecs.c6

StatusCategory

string

The resource category based on detailed inventory classification. Valid values:

  • WithStock: sufficient inventory.

  • ClosedWithStock: low inventory supply assurance. We recommend that you select an instance type with the WithStock status.

  • WithoutStock: sold out. Resources will be replenished. We recommend that you select an instance type with the WithStock status.

  • ClosedWithoutStock: sold out with no replenishment planned. Select an instance type with the WithStock status.

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.