FlavorListDetails
(Difference between revisions)
Line 18: | Line 18: | ||
"flavors":[ | "flavors":[ | ||
{ | { | ||
− | "name":" | + | "name":"{display_flavor_name}", |
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http:// | + | "href":"http://{server_name}/flavors/{flavor_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
Line 28: | Line 28: | ||
"ram":512, | "ram":512, | ||
"disk":10, | "disk":10, | ||
− | "id":" | + | "id":"{flavor_id}" |
}, | }, | ||
{ | { | ||
− | "name":" | + | "name":"{display_flavor_name}", |
"links":[ | "links":[ | ||
{ | { | ||
− | "href":"http:// | + | "href":"http://{server_name}/flavors/{flavor_id}/", |
"rel":"self" | "rel":"self" | ||
} | } | ||
Line 41: | Line 41: | ||
"ram":16384, | "ram":16384, | ||
"disk":60, | "disk":60, | ||
− | "id":" | + | "id":"{flavor_id}" |
} | } | ||
] | ] | ||
Line 55: | Line 55: | ||
; name - ''string'' | ; name - ''string'' | ||
− | : | + | : Display name for this flavor. |
; ram - ''number'' | ; ram - ''number'' | ||
Line 65: | Line 65: | ||
; vcpu - ''number'' | ; vcpu - ''number'' | ||
: Number of CPUs allocated with this flavor. | : Number of CPUs allocated with this flavor. | ||
+ | |||
+ | == Response Codes == | ||
+ | ; Success: HTTP/1.1 200 OK | ||
+ | |||
+ | ; Failure: HTTP/1.1 401 Unauthorized - This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required. | ||
+ | |||
+ | == Examples == | ||
+ | |||
+ | '''List flavors with details''' | ||
+ | :'''GET''' {server_name}/flavors/detail | ||
+ | |||
+ | ''Request Headers:'' | ||
+ | Content-Type:application/json | ||
+ | Charset=UTF-8 | ||
+ | Authorization:Base64-encoded username & password string | ||
+ | |||
+ | ''Response Code:'' | ||
+ | <pre>HTTP/1.1 200 OK</pre> | ||
+ | |||
+ | ''Response Body:'' | ||
+ | <big><source lang="javascript"> | ||
+ | { | ||
+ | "flavors":[ | ||
+ | { | ||
+ | "name":"Small", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/flavors/1/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "vcpu":1, | ||
+ | "ram":512, | ||
+ | "disk":10, | ||
+ | "id":"1" | ||
+ | }, | ||
+ | { | ||
+ | "name":"Large", | ||
+ | "links":[ | ||
+ | { | ||
+ | "href":"http://{server_name}/flavors/2/", | ||
+ | "rel":"self" | ||
+ | } | ||
+ | ], | ||
+ | "vcpu":4, | ||
+ | "ram":16384, | ||
+ | "disk":60, | ||
+ | "id":"2" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </source></big> | ||
+ | |||
+ | |||
+ | '''Unauthorized request''' | ||
+ | :'''GET''' {server_name}/flavors/detail | ||
+ | |||
+ | ''Request Headers:'' | ||
+ | Content-Type:application/json | ||
+ | |||
+ | ''Response Code:'' | ||
+ | <pre>HTTP/1.1 401 Unauthorized</pre> | ||
+ | |||
+ | ''Response Body:'' | ||
+ | 401 Unauthorized | ||
+ | This server could not verify that you are authorized to | ||
+ | access the document you requested. Either you supplied the | ||
+ | wrong credentials (e.g., bad password), or your browser | ||
+ | does not understand how to supply the credentials required. | ||
<!-- THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING--> | <!-- THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING--> |
Revision as of 18:06, 12 April 2012
This operation will list all available flavors with size details optionally limited by the query parameters.
GET /flavors/detail?minDisk=diskInGB&minRam=ramInMB
Contents |
Parameters
- minDisk - int
- Optional Only flavors only with a disk size greater than or equal to minDisk will be returned. Specified in GB.
- minRam - int
- Optional Only flavors with a memory size greater than or equal to minRam will be returned. Specified in MB.
Also see Pagination
Result
JSON
{ "flavors":[ { "name":"{display_flavor_name}", "links":[ { "href":"http://{server_name}/flavors/{flavor_id}/", "rel":"self" } ], "vcpu":1, "ram":512, "disk":10, "id":"{flavor_id}" }, { "name":"{display_flavor_name}", "links":[ { "href":"http://{server_name}/flavors/{flavor_id}/", "rel":"self" } ], "vcpu":4, "ram":16384, "disk":60, "id":"{flavor_id}" } ] }
- id - string
- Unique identifier for this flavor.
- links - array
- Hypermedia for this resource.
- name - string
- Display name for this flavor.
- ram - number
- Memory allocated with this flavor. Specified in MB.
- disk - number
- Disk space allocated with this flavor. Specified in GB.
- vcpu - number
- Number of CPUs allocated with this flavor.
Response Codes
- Success
- HTTP/1.1 200 OK
- Failure
- HTTP/1.1 401 Unauthorized - This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
Examples
List flavors with details
- GET {server_name}/flavors/detail
Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
Response Code:
HTTP/1.1 200 OK
Response Body:
{ "flavors":[ { "name":"Small", "links":[ { "href":"http://{server_name}/flavors/1/", "rel":"self" } ], "vcpu":1, "ram":512, "disk":10, "id":"1" }, { "name":"Large", "links":[ { "href":"http://{server_name}/flavors/2/", "rel":"self" } ], "vcpu":4, "ram":16384, "disk":60, "id":"2" } ] }
Unauthorized request
- GET {server_name}/flavors/detail
Request Headers:
Content-Type:application/json
Response Code:
HTTP/1.1 401 Unauthorized
Response Body:
401 Unauthorized This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.