Skip to main content

List Flavors

GET/v2.1/flavors/detail

A flavor defines the compute capacity of a VM: number of vCPUs, RAM, and root disk size. When you create a VM, flavorRef expects a flavor ID, so list the flavors first and keep the ID that matches the size you need.

Use /v2.1/flavors/detail to get vCPUs, RAM, and disk in one call. The plain /v2.1/flavors endpoint returns only id, name, and links, which is usually not enough to pick a size.

Request​

Query parameters​

limitinteger

Maximum number of flavors to return per page.

markerstring

ID of the last flavor seen in the previous page. Use it for pagination.

minDiskinteger

Minimum root disk size in GiB.

minRaminteger

Minimum RAM in MiB.

sort_keystring

Sort by flavorid, name, memory_mb, vcpus, root_gb, ephemeral_gb, swap, rxtx_factor, created_at, or updated_at. Default: flavorid.

sort_dirstring

asc or desc. Default: asc.

is_publicstring

Filter public or private flavors. This parameter applies to administrators only; for other users it is ignored and only public flavors are returned.

Sample Request​

curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
'https://api.vietnix.cloud:8774/v2.1/flavors/detail?minRam=4096&sort_key=vcpus&sort_dir=asc'

Response​

flavorsarrayrequired

List of flavor objects.

idstringrequired

Flavor UUID. This is the value to pass as flavorRef.

namestringrequired

Flavor name. Names are not unique across projects, IDs are.

vcpusintegerrequired

Number of virtual CPUs.

ramintegerrequired

RAM in MiB.

diskintegerrequired

Root disk in GiB. 0 means the flavor has no local root disk and the VM must boot from a volume.

swapintegerrequired

Swap space in MiB. 0 means no swap.

rxtx_factorfloatrequired

Receive/transmit factor applied to the flavor bandwidth quota.

OS-FLV-EXT-DATA:ephemeralintegerrequired

Ephemeral disk size in GiB.

os-flavor-access:is_publicbooleanrequired

true for public flavors, false for private ones.

Sample Response​

Response body
{
"flavors": [
{
"id": "468c0c15-08bd-4e1d-8564-5053ce12966b",
"name": "2x4",
"vcpus": 2,
"ram": 4096,
"disk": 20,
"swap": 0,
"rxtx_factor": 1.0,
"OS-FLV-EXT-DATA:ephemeral": 0,
"os-flavor-access:is_public": true,
"links": [
{
"rel": "self",
"href": "https://api.vietnix.cloud:8774/v2.1/flavors/468c0c15-08bd-4e1d-8564-5053ce12966b"
},
{
"rel": "bookmark",
"href": "https://api.vietnix.cloud:8774/flavors/468c0c15-08bd-4e1d-8564-5053ce12966b"
}
]
}
]
}

Status Code​

Success​

Status CodeDescription
200 - OKRequest was successful.

Error​

Status CodeDescription
400 - Bad RequestSome content in the request was invalid.
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.
note

A private flavor that belongs to another project is not listed and returns 404 on direct access, so the API does not reveal that it exists.