• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Flavors
  6. Querying Flavor Details

Querying Flavor Details

Function Description

This interface is used to query details about the ECS flavors.

Interface Format

Method

URI

Description

GET

/v2/{tenant_id}/flavors/detail

/v2.1/{tenant_id}/flavors/detail

Queries details about the ECS flavors.

Restrictions

N/A

Expanded Interface

N/A

Request Parameter

Fields in the following table can be used as URI parameters to filter query results.

An example of setting the parameters as URI parameters is as follows:

/v2/{tenant_id}/flavors/detail?minDisk={minDisk}&minRam={minRam}

Parameter

Type

Mandatory

Description

minDisk

String

No

Specifies the minimum disk size in GB. Only the ECSs with a disk size greater than or equal to the minimum size can be queried.

minRam

String

No

Specifies the minimum memory size in MB. Only flavors with the memory size greater than or equal to this value can be queried.

is_public

Boolean

No

Specifies whether to display public flavors. Only administrators can query private flavors. The value can be true, false, or none. If a non-admin user specifies the is_public value, the value is invalid, and all public flavors will be returned.

sort_key

String

No

Specifies the sorting field. The default value is flavorid. The value of this parameter can also be name, memory_mb, vcpus, root_gb, or flavorid.

sort_dir

String

No

Specifies the ascending or descending order. The default value is asc. You can set the sorting order to ascending or descending for specific parameters.

Response Parameter

Parameter

Type

Mandatory

Description

id

String

Yes

Specifies the flavor ID.

links

List(Dict)

Yes

Specifies information about the flavor URI.

name

String

Yes

Specifies the flavor name.

ram

Int

Yes

Specifies the memory size in MB.

OS-FLV-DISABLED:disabled

Bool

Yes

Extended attribute. Specifies whether the flavor is disabled.

vcpus

Int

Yes

Specifies the number of CPUs.

swap

String

Yes

Extended attribute. Specifies the size of the swap partition.

os-flavor-access:is_public

Bool

Yes

Extended attribute. Specifies whether the flavor is public.

rxtx_factor

Int

Yes

Specifies network bandwidth factors. This parameter can be used to enable ECSs with different flavors connecting to the same network to have different network bandwidths.

OS-FLV-EXT-DATA:ephemeral

Int

Yes

Specifies the size of the second disk. This is an extended attribute.

disk

Int

Yes

Specifies the size of the hard disk in GB.

Request Example

GET /v2/9c53a566cb3443ab910cf0daebca90c4/flavors/detail
GET /v2.1/9c53a566cb3443ab910cf0daebca90c4/flavors/detail

Response Example

{
    "flavors": [
        {
            "name": "m1.large",
            "links": [
                {
                    "href": "http://192.168.82.222:8774/v2/9c53a566cb3443ab910cf0daebca90c4/flavors/4",
                    "rel": "self"
                },
                {
                    "href": "http://192.168.82.222:8774/9c53a566cb3443ab910cf0daebca90c4/flavors/4",
                    "rel": "bookmark"
                }
            ],
            "ram": 8192,
            "OS-FLV-DISABLED:disabled": false,
            "vcpus": 4,
            "swap": "",
            "os-flavor-access:is_public": true,
            "rxtx_factor": 1,
            "OS-FLV-EXT-DATA:ephemeral": 0,
            "disk": 80,
            "id": "4"
        },
        {
            "name": "m1.xlarge",
            "links": [
                {
                    "href": "http://192.168.82.222:8774/v2/9c53a566cb3443ab910cf0daebca90c4/flavors/5",
                    "rel": "self"
                },
                {
                    "href": "http://192.168.82.222:8774/9c53a566cb3443ab910cf0daebca90c4/flavors/5",
                    "rel": "bookmark"
                }
            ],
            "ram": 16384,
            "OS-FLV-DISABLED:disabled": false,
            "vcpus": 8,
            "swap": "",
            "os-flavor-access:is_public": true,
            "rxtx_factor": 1,
            "OS-FLV-EXT-DATA:ephemeral": 0,
            "disk": 160,
            "id": "5"
        }
    ]
}

Returned Values

See section General Request Returned Values.

Error Code

See section Error Code Description.