• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. Extension ECS APIs
  5. Flavor Management
  6. Querying the Target ECS Flavors to Which a Flavor Can Be Changed

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

Function Description

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

URI

GET /v2.1/{project_id}/resize_flavors?{instance_uuid,source_flavor_id,source_flavor_name}

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Request parameters

NOTE:

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

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

instance_uuid

No

String

Specifies the ID, in UUID format, of the target ECS.

source_flavor_id

No

String

Specifies the source flavor ID.

source_flavor_name

No

String

Specifies the source flavor name.

sort_key

No

String

Indicates the field for sorting.

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 or descending sorting.

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 1000.

marker

No

String

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

Response

Response parameters

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Mandatory

Type

Description

flavors

Yes

List data structure

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. The value 0 indicates that the disk size is not limited.

The field is invalid on the cloud platform.

swap

No

String

This is an extended attribute.

NOTE:

This parameter is not used.

OS-FLV-EXT-DATA:ephemeral

Yes

Integer

This is an extended attribute.

NOTE:

This parameter is not used.

OS-FLV-DISABLED:disabled

Yes

Boolean

This is an extended attribute, specifying whether a flavor is available.

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

This parameter is not used.

rxtx_factor

Yes

Float

This is an extended attribute.

NOTE:

This parameter is not used.

os-flavor-access:is_public

Yes

Boolean

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

  • 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

List data structure

Specifies the shortcut link of the ECS flavor.

For details, see Table 5.

extra_specs

Yes

List data structure

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.

Examples

  • Example response
    {
        "flavors": [{
               "name": "c1.large",
               "links": [{
                      "href": "https://compute-ext.localdomain.com:8880/v1/d47580aac1dd4cecad04f695f216d1f7/flavors/c1.large",
                      "rel": "self"
               },
               {
                      "href": "https://compute-ext.localdomain.com:8880/d47580aac1dd4cecad04f695f216d1f7/flavors/c1.large",
                      "rel": "bookmark"
               }],
               "ram": 2048,
               "OS-FLV-DISABLED:disabled": false,
               "vcpus": 2,
               "extra_specs": {
                      "ecs:performancetype": "cpuv1",
                      "resource_type": "normal"
               },
               "swap": "",
               "os-flavor-access:is_public": false,
               "rxtx_factor": 1.0,
               "OS-FLV-EXT-DATA:ephemeral": 0,
               "disk": 30,
               "id": "c1.large"
        }]
    }

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.