Help Center/ Elastic Cloud Server/ API Reference/ APIs/ Flavor Management/ Querying the Capacity of a Flavor
Updated on 2025-09-19 GMT+08:00

Querying the Capacity of a Flavor

Function

This API is used to query the capacity of a flavor.

URI

GET /v1/{project_id}/cloudservers/flavors/{flavor_id}/resources

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

flavor_id

Yes

Specifies the flavor ID.

Request

None.

Response

Table 2 describes the response parameter.

Table 2 Response parameters

Parameter

Type

Description

resources

Array of objects

Definition

Specifies the capacity list of the flavor. For details, see Table 3.

Range

N/A

Table 3 resources field description

Parameter

Type

Description

region_id

String

Definition

Specifies the ID of the region that the flavor belongs to.

Range

N/A

availability_zone

String

Definition

Specifies the AZ that the flavor belongs to.

Range

N/A

prefer

Boolean

Definition

Specifies whether the resources of the flavor in the current AZ are sufficient.

Range

  • true: Sufficient
  • false: Insufficient

Example Request

Query the capacity of a flavor.

GET https://{endpoint}/v1/{project_id}/cloudservers/flavors/{flavor_id}/resources

Example Response

{
	"resources": [{
		"region_id": "region_01",
		"availability_zone": "az1",
		"prefer": false
	}]
}

Error Codes

See Error Codes.