Help Center/ Elastic Cloud Server/ API Reference/ APIs/ Flavor Management/ Querying the Target ECS Flavors to Which a Flavor Can Be Changed
Updated on 2025-08-20 GMT+08:00

Querying the Target ECS Flavors to Which a Flavor Can Be Changed

Function

An ECS flavor cannot be changed to certain flavors. This API is used to query the target flavors to which a specified ECS flavor can be changed.

URI

GET /v1/{project_id}/cloudservers/resize_flavors

Table 1 describes the parameters in the URI.
Table 1 Path parameters

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

One of the instance_uuid, source_flavor_id, and source_flavor_name parameters must be configured. If multiple parameters are configured, the system processes the instance_uuid, source_flavor_id, and source_flavor_name parameters in descending order by default.

If instance_uuid is used to query the flavors that can be changed to, only the flavors supporting the image based on which the target ECS is created are returned. The reason is as follows: Images rely on flavors. If an ECS is created using a public image, the API filters the flavors supported by the image.

Table 2 describes the query parameters.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

instance_uuid

No

String

Definition

Specifies the target ECS ID in UUID format.

Constraints

N/A

Range

N/A

Default Value

N/A

source_flavor_id

No

String

Definition

Specifies the source flavor ID.

Constraints

N/A

Range

N/A

Default Value

N/A

source_flavor_name

No

String

Definition

Specifies the source flavor name.

Constraints

N/A

Range

N/A

Default Value

N/A

sort_key

No

String

Definition

Indicates the field for sorting.

Constraints

N/A

Range

  • flavorid: indicates the flavor ID.
  • name: indicates the flavor name.
  • memory_mb: indicates the memory size.
  • vcpus: indicates the number of vCPUs.
  • root_gb: indicates the system disk size.

Default Value

flavorid

sort_dir

No

String

Definition

Specifies the sorting of ECS flavors.

Constraints

N/A

Range

  • asc: indicates the ascending order.
  • desc: indicates the descending order.

Default Value

asc

limit

No

Integer

Definition

Specifies the maximum number of flavors that can be displayed per page.

Constraints

N/A

Range

N/A

Default Value

1000

marker

No

String

Definition

Specifies the ID of the last flavor on each page as the paging marker.

Constraints

N/A

Range

N/A

Default Value

N/A

Request

None

Response

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Description

flavors

Array of objects

Definition

Specifies ECS flavors.

For details, see Table 4.

Range

N/A

Table 4 flavors field description

Parameter

Type

Description

id

String

Definition

Specifies the ECS flavor ID.

Range

N/A

name

String

Definition

Specifies the ECS flavor name.

Range

N/A

vcpus

String

Definition

Specifies the number of vCPUs in the ECS flavor.

Range

N/A

ram

Integer

Definition

Specifies the memory size (MiB) in the ECS flavor.

Range

N/A

disk

String

Definition

Specifies the system disk size in the ECS flavor.

This parameter has not been used. Its default value is 0.

Range

N/A

swap

String

Definition

Specifies the swap partition size required by the ECS flavor.

This parameter has not been used. Its default value is "".

Range

N/A

OS-FLV-EXT-DATA:ephemeral

Integer

Definition

Specifies the temporary disk size. This is an extended attribute.

This parameter has not been used. Its default value is 0.

Range

N/A

OS-FLV-DISABLED:disabled

Boolean

Definition

Specifies whether the ECS flavor has been disabled. This is an extended attribute.

This parameter has not been used. Its default value is false.

Range

N/A

rxtx_factor

Float

Definition

Specifies the ratio of the available network bandwidth to the network hardware bandwidth of the ECS.

This parameter has not been used. Its default value is 1.

Range

N/A

rxtx_quota

String

Definition

Specifies the software constraints of the network bandwidth that can be used by the ECS.

This parameter has not been used. Its default value is null.

Range

N/A

rxtx_cap

String

Definition

Specifies the hardware constraints of the network bandwidth that can be used by the ECS.

This parameter has not been used. Its default value is null.

Range

N/A

os-flavor-access:is_public

Boolean

Definition

Specifies whether a flavor is available to all tenants. This is an extended attribute.

Range

  • true: indicates that a flavor is available to all tenants.
  • false: indicates that a flavor is available only to certain tenants.

Default value: true

links

Array of objects

Definition

Specifies the shortcut link of the ECS flavor.

For details, see Table 5.

Range

N/A

extra_specs

Object

Definition

Specifies the extended field of the ECS flavor.

For details, see Table 6.

Range

N/A

instance_quota

Object

Definition

This is a reserved parameter.

Range

N/A

Table 5 links field description

Parameter

Type

Description

rel

String

Definition

Specifies the shortcut link marker name.

Range

N/A

href

String

Definition

Provides the shortcut link.

Range

N/A

type

String

Definition

Specifies the shortcut link type. This parameter has not been used. Its default value is null.

Range

N/A

Example Request

Query the flavors that the ECS flavor c3.xlarge.2 can be changed to.

GET https://{endpoint}/v1/{project_id}/cloudservers/resize_flavors?source_flavor_id=c3.xlarge.2

Example Response

{
    "flavors": [
        {
            "id": "c3.15xlarge.2",
            "name": "c3.15xlarge.2",
            "vcpus": "60",
            "ram": 131072,
            "disk": "0",
            "swap": "",
            "links": [
                {
                    "rel": "self",
                    "href": "https://ecs.region.example.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2",
                    "type": null
                },
                {
                    "rel": "bookmark",
                    "href": "https://ecs.region.example.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2",
                    "type": null
                }
            ],
            "OS-FLV-EXT-DATA:ephemeral": 0,
            "rxtx_factor": 1,
            "OS-FLV-DISABLED:disabled": false,
            "rxtx_quota": null,
            "rxtx_cap": null,
            "os-flavor-access:is_public": true,
            "extra_specs": {
                "ecs:virtualization_env_types": "CloudCompute",
                "ecs:generation": "c3",
                "ecs:performancetype": "computingv3",
                "resource_type": "IOoptimizedC3_2"
             }
        }
    ]
}

Error Codes

See Error Codes.