Help Center/ Bare Metal Server/ API Reference/ Native OpenStack Nova V2.1 APIs/ BMS Flavor Query/ Querying Details About a BMS Flavor (Native OpenStack API)
Updated on 2024-05-17 GMT+08:00

Querying Details About a BMS Flavor (Native OpenStack API)

Function

This API is used to query details about a BMS flavor, such as the flavor name, CPU cores, and memory.

URI

GET /v2.1/{project_id}/flavors/{flavor_id}

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

flavor_id

Yes

Specifies the flavor ID.

You can obtain the flavor ID from the BMS console or using the Querying BMS Flavors (Native OpenStack API) API.

Request Parameters

None

Example Request

Query details about a flavor (ID: physical.o2.medium)
1
GET https://{ECS Endpoint}/v2.1/c685484a8cc2416b97260938705deb65/flavors/physical.o2.medium

Response Parameters

Parameter

Type

Description

flavor

Object

Specifies a BMS flavor. For details, see Table 2.

Table 2 flavor field description

Parameter

Type

Description

id

String

Specifies the BMS flavor ID.

name

String

Specifies the BMS flavor name.

vcpus

Integer

Specifies the number of CPU cores in the BMS flavor.

ram

Integer

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

disk

Integer

Specifies the disk size (GB) in the BMS flavor.

swap

String

This is a reserved attribute.

OS-FLV-EXT-DATA:ephemeral

Integer

This is a reserved attribute.

OS-FLV-DISABLED:disabled

Boolean

This is a reserved attribute.

rxtx_factor

Float

This is a reserved attribute.

os-flavor-access:is_public

Boolean

This is a reserved attribute.

links

Array of objects

Specifies shortcut links of the BMS flavor. For details, see Table 3.

Table 3 links field data structure description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

  • self: resource link that contains the version number. It is used when immediate tracing is required.
  • bookmark: resource link that can be stored for a long time.

href

String

Specifies the corresponding shortcut link.

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
    "flavor": {
        "name": "physical.o2.medium",
        "links": [
            {
                "href": "https://openstack.example.com/v2/c685484a8cc2416b97260938705deb65/flavors/physical.o2.medium",
                "rel": "self"
            },
            {
                "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/flavors/physical.o2.medium",
                "rel": "bookmark"
            }
        ],
        "ram": 192705,
        "OS-FLV-DISABLED:disabled": false,
        "vcpus": 24,
        "swap": "",
        "os-flavor-access:is_public": true,
        "rxtx_factor": 1,
        "OS-FLV-EXT-DATA:ephemeral": 0,
        "disk": 1862,
        "id": "physical.o2.medium"
    }
                }

Returned Values

Normal values

Returned Values

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.