Help Center/ Elastic Cloud Server/ API Reference/ Out-of-Date APIs/ Flavor Management/ Querying the Target Flavors to Which an ECS Flavor Can Be Changed (Discarded)
Updated on 2024-12-19 GMT+08:00

Querying the Target Flavors to Which an ECS Flavor Can Be Changed (Discarded)

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.

This API has been discarded. Use the API described in Querying the Target ECS Flavors to Which a Flavor Can Be Changed.

URI

GET /v2.1/{project_id}/resize_flavors?instance_uuid={instance_uuid}&source_flavor_id={source_flavor_id}&source_flavor_name={source_flavor_name}&sort_key={sort_key}&sort_dir={sort_dir}&limit={limit}&marker={marker}

Table 1 lists the parameters.
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.

Table 2 describes the query parameters.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

instance_uuid

No

String

Specifies the target ECS ID in UUID format.

source_flavor_id

No

String

Specifies the source flavor ID.

source_flavor_name

No

String

Specifies the source flavor name.

sort_key

No

String

Specifies the field for sorting.

Value options:

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

sort_dir

No

String

Specifies the ascending (asc) or descending (desc) sorting.

Value options:

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

limit

No

Integer

Specifies the maximum number of flavors that can be displayed on one page. The default value is 1,000.

marker

No

String

Uses the ID of the last flavor on one page as the paging marker.

Request

None

Response

Table 3 describes the response parameter.

Table 3 Response parameter

Parameter

Mandatory

Type

Description

flavors

Yes

Array of objects

Specifies ECS flavors.

For details, see Table 4.

Table 4 flavors field description

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the ECS flavor ID.

name

Yes

String

Specifies the name of the ECS flavor.

vcpus

Yes

Integer

Specifies the number of vCPUs in the ECS flavor.

ram

Yes

Integer

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

disk

Yes

Integer

Specifies the system disk size in the ECS flavor.

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

swap

No

String

Specifies the swap partition size required by the ECS flavor.

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

OS-FLV-EXT-DATA:ephemeral

Yes

Integer

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

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

OS-FLV-DISABLED:disabled

Yes

Boolean

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

  • true: indicates that the flavor is available.
  • false: indicates that the flavor is unavailable.
NOTE:

This parameter has not been used.

rxtx_factor

Yes

Float

This is an extended attribute.

NOTE:

This parameter has not been used.

rxtx_quota

Yes

String

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.

rxtx_cap

Yes

String

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.

os-flavor-access:is_public

Yes

Boolean

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

  • 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

Yes

Array of objects

Specifies the shortcut link of the ECS flavor.

For details, see Table 5.

extra_specs

Yes

Array of objects

Specifies the extended field of the ECS specifications.

For details, see Table 6.

Table 5 links field description

Parameter

Mandatory

Type

Description

rel

Yes

String

Specifies the shortcut link marker name.

href

Yes

String

Specifies the shortcut link.

type

Yes

String

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

Example Request

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://compute-ext.region.example.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2",
                    "type": null
                },
                {
                    "rel": "bookmark",
                    "href": "https://compute-ext.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.