Get flavor details

Overview

Gets details for a specified flavor.

Classification

  • Show

API Operation Object

  • flavors

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{project_id}/flavors/{flavor_id}

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
flavor_id URL String(1-255 characters) flavor id required - Terminate 404
token_id Header authentication token string keystone authentication token required - Terminate 401

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
401 unauthorized
404 not found a specified project
- not found a specified flavor

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

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 String(1-255 characters) flavor url
flavor_bookmark_URL int flavor bookmark url
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/{flavor_id}

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

Execution Example

HTTP Request

GET /v2/bd35ce077cd440a58df9c7788f52901a/flavors/1 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: 426
X-Compute-Request-Id: req-24e02f2d-5436-41c0-b956-7d4db7231176
Date: Wed, 23 Jul 2014 05:04:29 GMT

{"flavor": {"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"}}

Error Execution Example

HTTP Request

GET /v2/b17a6492bfa54441910e15f07c98384/flavors/1 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 23624b4b115d45c8bef88037c1a6a7b2
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 187
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-cf4e08e4-13a5-4d56-b1e6-e919f34989d0
Date: Tue, 06 Oct 2015 09:08:30 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id 'b17a6492bfa54441910e15f07c98384' doesn't match Context's project_id 'b17a6492bfa54441910e15f07c983384'", "code": 400}}