• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. API Reference
  4. API
  5. BMS Flavor Query (Native OpenStack APIs)
  6. Querying BMS Flavors (Native OpenStack API)

Querying BMS Flavors (Native OpenStack API)

Function

This interface is used to query flavors of BMSs and display the query results in a list.

Constraints

The flavors you obtained using this interface are all the flavors in the system. The flavors whose names starting with physical are BMS flavors and can be used to create BMSs.

URI

GET /v2.1/{project_id}/flavors/detail{?minDisk,minRam,is_public,sort_key,sort_dir}

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Table 2 lists the optional parameters that can be used to query BMS flavors.

Table 2 Optional parameters

Parameter

Type

Mandatory

Description

minDisk

String

No

Specifies the minimum disk size in GB. Only the BMSs 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 the BMSs with the memory size greater than or equal to the minimum size can be queried.

is_public

Boolean

No

Specifies whether public flavors are displayed. The private flavors are available only to user admin. The value can be true, false, or none. If this parameter is configured by a non-admin user, the system returns all public images.

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 sorting order, which can be ascending (asc) or descending (desc). The default value is asc.

Request Message

N/A

Response Message

  • Response parameters

    Parameter

    Type

    Description

    flavors

    List data structure [2]

    Specifies the list of BMS flavors.

    [2] flavors field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the ID of the BMS flavor.

    name

    String

    Specifies the name of the BMS flavor.

    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

    List data structure [3]

    Specifies the shortcut link of the BMS flavor.

    [3] links field data structure description

    Parameter

    Type

    Description

    rel

    String

    Specifies the shortcut link marker name.

    href

    String

    Specifies the corresponding shortcut link.

  • Example response
    {
        "flavors": [
            "name": "physical.84.medium",
            "links": [
                {
                    "href": "https://openstack.example.com/v2/c685484a8cc2416b97260938705deb65/flavors/physical.84.medium",
                    "rel": "self"
                },
                {
                    "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/flavors/physical.84.medium",
                    "rel": "bookmark"
                 }
            ],
            "ram": 321725,
            "OS-FLV-DISABLED:disabled": false,
            "vcpus": 56,
            "swap": "",
            "os-flavor-access:is_public": true,
            "rxtx_factor": 1,
            "OS-FLV-EXT-DATA:ephemeral": 0,
            "disk": 3725,
            "id": "physical.84.medium"
        ]
                    }

Returned Values

See section Common Returned Values.