• Native OpenStack API

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

Querying Details About a Flavor

Function Description

This interface is used to query details about an ECS flavor.

Interface Format

Method

URI

Description

GET

/v2/{tenant_id}/ flavors /{flavors _id}

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

Queries details about an ECS flavor.

Restrictions

N/A

Expanded Interface

N/A

Request Parameter

N/A

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. The unit is 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

Extended attribute. Specifies the size of the second disk.

disk

Int

Yes

Specifies the size of the hard disk (GB).

Request Example

GET /v2/9c53a566cb3443ab910cf0daebca90c4/flavors/8

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

Response Example

{
    "flavor": {
        "name": "wj.gpu",
        "links": [
            {
                "href": "http://192.168.82.222:8774/v2/9c53a566cb3443ab910cf0daebca90c4/flavors/8",
                "rel": "self"
            },
            {
                "href": "http://192.168.82.222:8774/9c53a566cb3443ab910cf0daebca90c4/flavors/8",
                "rel": "bookmark"
            }
        ],
        "ram": 1024,
        "OS-FLV-DISABLED:disabled": false,
        "vcpus": 1,
        "swap": "",
        "os-flavor-access:is_public": true,
        "rxtx_factor": 1,
        "OS-FLV-EXT-DATA:ephemeral": 0,
        "disk": 10,
        "id": "8"
    }
}

Returned Values

See section General Request Returned Values.

Error Code

Table 1 Task error code

Error Code

Description

404

The resource could not be found.

This error occurs because the flavor does not exist. Check whether the flavor exists.