Listing flavors

GET /flavors

List all flavors accessible to the specified project.

Source: https://docs.openstack.org/api-ref/compute/?expanded=list-flavors-detail#list-flavors

Request

Parameters

Name In Type Description
sort_key (Optional) query string

Sorts by a flavor attribute. Default attribute is flavorid. 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 flavor sort_key attribute. The sort keys are limited to:

  • created_at
  • description
  • disabled
  • ephemeral_gb
  • flavorid
  • id
  • is_public
  • memory_mb
  • name
  • root_gb
  • rxtx_factor
  • swap
  • updated_at
  • vcpu_weight
  • vcpus
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.

Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/flavors

Response

Parameters

Name In Type Description
flavors body array An array of flavor objects.
name body string The display name of a flavor.
description body string

The description of the flavor.

New in version 2.55

id body string The ID of the flavor. While it may look like an integer, this is really a string.
links body array Links to the resources in question. See API Guide / Links and References for more info.

Status codes

Success

Code Reason
200 - OK Request was successful.

Error

Code Reason
401 - Unauthorized

User must authenticate before making a request.

403 - Forbidden

Policy does not allow current user to do this operation.

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"
    }
  ]
}