List details for flavors

Overview

Lists all details for available flavors.

Classification

  • List

API Operation Object

  • flavors

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{project_id}/flavors/detail

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional default value action for invalid parameter response code for invalid parameter
project_id URL UUID(3) Project id required - Terminate 400, 404
token_id Header authentication token string keystone authentication token required - Terminate 401
minDisk Query int Integer value for the minimum disk space in GB so you can filter results optional - Terminate 400
minRam Query int Integer value for the minimum RAM so you can filter results. optional - Terminate 400
marker Query UUID UUID of the flavor at which you want to set a marker optional - Terminate 400
limit Query int Integer value for the limit of values to return. optional - Terminate 500
sort_dir Query asc or desc A time/date stamp for when the flavor last changed. optional asc Terminate 500
sort_key Query String(nolimit) A time/date stamp for when the flavor last changed. optional flavorid Terminate 500
is_public Query True or False public flag for filtering result(admin only) optional - Terminate 400

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Code

Response Codes
response code condition
200 normal end
400 is_public is not True or False, None (admin only)
- minRam is not integer
- minDisk is not integer
- not found a specified flavor UUID for marker
401 unauthorized
404 not found a specified project
500 sort direction is not desc or asc
- sort key is invalid value
- limit is no integer

HTTP Response Body

Format

{
  "flavors": [
    {
      "OS-FLV-DISABLED:disabled": <disable_flag>,
      "OS-FLV-EXT-DATA:ephemeral": <ephemeral_disk_size>,
      "disk": <disk_size>,
      "id": "<flavor_id>",
      "links": [
        {
          "href": "<flavor_URL>",
          "rel": "self"
        },
        {
          "href": "<flavor_bookmark_URL>",
          "rel": "bookmark"
        }
      ],
      "name": "<flavor_name>",
      "os-flavor-access:is_public": <public_flag>,
      "ram": <memory_size>,
      "rxtx_factor": <rxtx_factor>,
      "swap": "<swap_size>",
      "vcpus": <vcpu_num>
    },
    <<repeat>>
  ]
}

Response Parameter

Response Parameters
item format description
disable_flg boolean disable flag for flavor
ephemeral_disk_size int(0-2^31-1) ephemeral disk size(GB)
disk_size int(0-2^31-1) disk size
id String(1-255 characters) flavor id
flavor_URL URL URL of flavor
flavor_bookmark_URL URL URL of flavor bookmarks
flavor_name String(1-255 characters) flavor name
public_flag boolean public flag for flavor
rxtx_factor float(>= 0) RX/TX factor
swap_size int(0-2^31-1) or empty string swap size
vcpu_num int(0-2^31-1) number of vcpu

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{project_id}/flavors/detail

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "Content-Length", "Date"

Response Body

{
  "flavors": [
    {
      "OS-FLV-DISABLED:disabled": <disable_flag>,
      "OS-FLV-EXT-DATA:ephemeral": <ephemeral_disk_size>,
      "disk": <disk_size>,
      "id": "<flavor_id>",
      "links": [
        {
          "href": "<flavor_URL>",
          "rel": "self"
        },
        {
          "href": "<flavor_bookmark_URL>",
          "rel": "bookmark"
        }
      ],
      "name": "<flavor_name>",
      "os-flavor-access:is_public": <public_flag>,
      "ram": <memory_size>,
      "rxtx_factor": <rxtx_factor>,
      "swap": "<swap_size>",
      "vcpus": <vcpu_num>
    },
    <<repeat>>
  ]
}

Execution Example

HTTP Request

GET /v2/bd35ce077cd440a58df9c7788f52901a/flavors/detail HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.150.51:8774
Accept-Encoding: gzip, deflate, compress
Accept: application/json
X-Auth-Token: 3e994564f8ac436985aa8eec3e1bae81
X-Auth-Project-Id: demo

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2109
X-Compute-Request-Id: req-d37a199b-3a14-44fd-80d9-f69e028a14e2
Date: Wed, 23 Jul 2014 04:57:47 GMT

{"flavors": [{"name": "m1.tiny", "links": [{"href": "http://192.168.150.51:8774/v2/bd35ce077cd440a58df9c7788f52901a/flavors/1", "rel": "self"}, {"href": "http://192.168.150.51:8774/bd35ce077cd440a58df9c7788f52901a/flavors/1", "rel": "bookmark"}], "ram": 512, "OS-FLV-DISABLED:disabled": false, "vcpus": 1, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 1, "id": "1"}, {"name": "m1.small", "links": [{"href": "http://192.168.150.51:8774/v2/bd35ce077cd440a58df9c7788f52901a/flavors/2", "rel": "self"}, {"href": "http://192.168.150.51:8774/bd35ce077cd440a58df9c7788f52901a/flavors/2", "rel": "bookmark"}], "ram": 2048, "OS-FLV-DISABLED:disabled": false, "vcpus": 1, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 20, "id": "2"}, {"name": "m1.medium", "links": [{"href": "http://192.168.150.51:8774/v2/bd35ce077cd440a58df9c7788f52901a/flavors/3", "rel": "self"}, {"href": "http://192.168.150.51:8774/bd35ce077cd440a58df9c7788f52901a/flavors/3", "rel": "bookmark"}], "ram": 4096, "OS-FLV-DISABLED:disabled": false, "vcpus": 2, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 40, "id": "3"}, {"name": "m1.large", "links": [{"href": "http://192.168.150.51:8774/v2/bd35ce077cd440a58df9c7788f52901a/flavors/4", "rel": "self"}, {"href": "http://192.168.150.51:8774/bd35ce077cd440a58df9c7788f52901a/flavors/4", "rel": "bookmark"}], "ram": 8192, "OS-FLV-DISABLED:disabled": false, "vcpus": 4, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 80, "id": "4"}, {"name": "m1.xlarge", "links": [{"href": "http://192.168.150.51:8774/v2/bd35ce077cd440a58df9c7788f52901a/flavors/5", "rel": "self"}, {"href": "http://192.168.150.51:8774/bd35ce077cd440a58df9c7788f52901a/flavors/5", "rel": "bookmark"}], "ram": 16384, "OS-FLV-DISABLED:disabled": false, "vcpus": 8, "swap": "", "os-flavor-access:is_public": true, "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "disk": 160, "id": "5"}]}

Error Execution Example

HTTP Request

GET /v2/541452482fc84105974a09f20236f796/flavors/detail?minDisk=a HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: fd3ab9d54e204c88bc66c6918d01ede5
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 70
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-61a9de94-d825-4b7d-ac80-b77da9a4b070
Date: Mon, 28 Sep 2015 10:56:48 GMT

{"badRequest": {"message": "Invalid minDisk filter [a]", "code": 400}}