List Flavors
/v2.1/flavors/detailA 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.
Source: list-flavors-detail
Request
Query parameters
limitintegerMaximum number of flavors to return per page.
markerstringID of the last flavor seen in the previous page. Use it for pagination.
minDiskintegerMinimum root disk size in GiB.
minRamintegerMinimum RAM in MiB.
sort_keystringSort by flavorid, name, memory_mb, vcpus, root_gb, ephemeral_gb, swap, rxtx_factor, created_at, or updated_at. Default: flavorid.
sort_dirstringasc or desc. Default: asc.
is_publicstringFilter 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
- HTTP
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'
GET https://api.vietnix.cloud:8774/v2.1/flavors/detail?minRam=4096&sort_key=vcpus&sort_dir=asc
Response
flavorsarrayrequiredList of flavor objects.
idstringrequiredFlavor UUID. This is the value to pass as flavorRef.
namestringrequiredFlavor name. Names are not unique across projects, IDs are.
vcpusintegerrequiredNumber of virtual CPUs.
ramintegerrequiredRAM in MiB.
diskintegerrequiredRoot disk in GiB. 0 means the flavor has no local root disk and the VM must boot from a volume.
swapintegerrequiredSwap space in MiB. 0 means no swap.
rxtx_factorfloatrequiredReceive/transmit factor applied to the flavor bandwidth quota.
OS-FLV-EXT-DATA:ephemeralintegerrequiredEphemeral disk size in GiB.
os-flavor-access:is_publicbooleanrequiredtrue 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 Code | Description |
|---|---|
| 200 - OK | Request was successful. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |
| 403 - Forbidden | Policy does not allow current user to do this operation. |
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.