5.1. Listing flavors¶
GET /flavors
List all flavors accessible to the specified project.
Source: https://docs.openstack.org/api-ref/compute/?expanded=#list-flavors
5.1.1. Request¶
Name | In | Type | Description |
---|---|---|---|
sort_key (Optional) |
query | string | Sorts by a flavor attribute. Default attribute is
|
sort_dir (Optional) |
query | string | Sort direction. A valid value is asc (ascending) or desc (descending).
Default is asc . You can specify multiple pairs of sort key and sort direction
query parameters. If you omit the sort direction in a pair, the API uses the natural
sorting direction of the direction of the flavor sort_key attribute. |
limit (Optional) |
query | integer | Requests a page size of items. Returns a number of items up to a limit value.
Use the limit parameter to make an initial limited request and use the ID
of the last-seen item from the response as the marker parameter value in a
subsequent limited request. |
marker (Optional) |
query | string | The ID of the last-seen item. Use the limit parameter to make an initial limited
request and use the ID of the last-seen item from the response as the marker
parameter value in a subsequent limited request. |
minDisk (Optional) |
query | integer | Filters the response by a minimum disk space, in GiB. For example, 100 . |
minRam (Optional) |
query | integer | Filters the response by a minimum RAM, in MiB. For example, 512 . |
is_public (Optional) |
query | string | This parameter is only applicable to users with the administrative role.
For all other non-admin users, the parameter is ignored and only public
flavors will be returned. Filters the flavor list based on whether the
flavor is public or private. If the value of this parameter is not
specified, it is treated as True . If the value is specified, 1 ,
t , true , on , y and yes are treated as True . 0 ,
f , false , off , n and no are treated as False
(they are case-insensitive). If the value is None (case-insensitive)
both public and private flavors will be listed in a single request. |
5.1.1.1. Example¶
# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/flavors
5.1.2. Response¶
Name | In | Type | Description |
---|---|---|---|
flavors |
body | array | An array of flavor objects. |
id |
body | string | The ID of the flavor. While people often make this look like an int, this is really a string. |
name |
body | string | The display name of a flavor. |
description |
body | string | The description of the flavor. New in version 2.55 |
links |
body | array | Links to the resources in question. See API Guide / Links and References for more info. |
5.1.2.1. Status codes¶
5.1.2.1.1. Success¶
Code | Reason |
---|---|
200 - OK |
Request was successful. |
5.1.2.1.2. Error¶
Code | Reason |
---|---|
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
5.1.2.2. Example¶
{
"flavors": [
{
"id": "100",
"links": [
{
"href": "https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/flavors/100",
"rel": "self"
},
{
"href": "https://<node_IP_addr>:8774/f5d834d636c642c7bfe8af86139c6f26/flavors/100",
"rel": "bookmark"
}
],
"name": "tiny"
},
{
"id": "101",
"links": [
{
"href": "https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/flavors/101",
"rel": "self"
},
{
"href": "https://<node_IP_addr>:8774/f5d834d636c642c7bfe8af86139c6f26/flavors/101",
"rel": "bookmark"
}
],
"name": "small"
},
<...>
]
}
Version 5.0.0 — Feb 01, 2022