FlavorListDetails
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | = GET /flavors/detail?minDisk=''{diskInGB}''&minRam=''{ramInMB}'' = | ||
This operation will list all available flavors with size details optionally limited by the query parameters. | This operation will list all available flavors with size details optionally limited by the query parameters. | ||
+ | __TOC__ | ||
+ | == Request == | ||
+ | <code>GET /flavors/detail?minDisk=''{diskInGB}''&minRam=''{ramInMB}''</code> | ||
− | + | === URI Parameters === | |
− | + | ||
− | == Parameters == | + | |
; minDisk - ''int'' | ; minDisk - ''int'' | ||
: ''Optional'' Only flavors only with a disk size greater than or equal to minDisk will be returned. Specified in GB. | : ''Optional'' Only flavors only with a disk size greater than or equal to minDisk will be returned. Specified in GB. | ||
Line 12: | Line 14: | ||
''Also see [[Pagination]]'' | ''Also see [[Pagination]]'' | ||
− | == | + | == Response == |
− | === | + | |
+ | === Status Code === | ||
+ | ; 200 OK | ||
+ | : Success | ||
+ | |||
+ | ; 401 Unauthorized | ||
+ | : Failure - 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. | ||
+ | |||
+ | === Response Body === | ||
<nowiki> | <nowiki> | ||
{ | { | ||
− | + | "flavors":[ | |
− | + | { | |
− | + | "name":"{display_flavor_name}", | |
− | + | "links":[ | |
− | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/{flavor_id}/", "rel":"self"} | |
− | + | ], | |
− | + | "vcpu":1, | |
− | + | "ram":512, | |
− | + | "disk":10, | |
− | + | "id":"{flavor_id}" | |
− | + | }, | |
− | + | { | |
− | + | "name":"{display_flavor_name}", | |
− | + | "links":[ | |
− | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/{flavor_id}/", "rel":"self"} | |
− | + | ], | |
− | + | "vcpu":4, | |
− | + | "ram":16384, | |
− | + | "disk":60, | |
− | + | "id":"{flavor_id}" | |
− | + | } | |
− | + | ] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
</nowiki> | </nowiki> | ||
+ | ==== Parameters ==== | ||
; id - ''string'' | ; id - ''string'' | ||
: Unique identifier for this flavor. | : Unique identifier for this flavor. | ||
Line 64: | Line 69: | ||
; vcpu - ''number'' | ; vcpu - ''number'' | ||
: Number of CPUs allocated with this flavor. | : Number of CPUs allocated with this flavor. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
− | + | === Successfully list flavors with details === | |
− | + | '''Request''' | |
+ | <nowiki> | ||
+ | GET /flavors/detail | ||
+ | Authorization: Basic {Base64-encoded username:password string} | ||
+ | </nowiki> | ||
− | '' | + | '''Response''' |
− | + | <nowiki> | |
− | + | 200 OK | |
− | + | ||
− | + | { | |
− | < | + | "flavors":[ |
+ | { | ||
+ | "name":"Small", | ||
+ | "links":[ | ||
+ | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/1/", "rel":"self"} | ||
+ | ], | ||
+ | "vcpu":1, | ||
+ | "ram":512, | ||
+ | "disk":10, | ||
+ | "id":"1" | ||
+ | }, | ||
+ | { | ||
+ | "name":"Large", | ||
+ | "links":[ | ||
+ | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/2/", "rel":"self"} | ||
+ | ], | ||
+ | "vcpu":4, | ||
+ | "ram":16384, | ||
+ | "disk":60, | ||
+ | "id":"2" | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </nowiki> | ||
− | '' | + | === Failure while trying to make an unauthorized request === |
+ | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | + | GET /flavors/detail | |
− | + | Authorization: Basic {invalid authorization} | |
− | + | </nowiki> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | </nowiki> | + | |
− | ''' | + | '''Response''' |
− | + | <nowiki> | |
− | + | 401 Unauthorized | |
− | + | </nowiki> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | == See also == | |
− | + | * [[FlexCloud Server|FlexCloud Server API]] | |
− | + | * [[Common Features]] | |
− | + | ||
− | + | ||
− | + | ||
+ | {{disqus}} | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:FlexCloud Server API]] | [[Category:FlexCloud Server API]] |
Revision as of 11:29, 24 May 2013
GET /flavors/detail?minDisk={diskInGB}&minRam={ramInMB}
This operation will list all available flavors with size details optionally limited by the query parameters.
Contents |
Request
GET /flavors/detail?minDisk={diskInGB}&minRam={ramInMB}
URI 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
Response
Status Code
- 200 OK
- Success
- 401 Unauthorized
- Failure - 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.
Response Body
{ "flavors":[ { "name":"{display_flavor_name}", "links":[ {"href":"https://api.hostway.com/flavors/{flavor_id}/", "rel":"self"} ], "vcpu":1, "ram":512, "disk":10, "id":"{flavor_id}" }, { "name":"{display_flavor_name}", "links":[ {"href":"https://api.hostway.com/flavors/{flavor_id}/", "rel":"self"} ], "vcpu":4, "ram":16384, "disk":60, "id":"{flavor_id}" } ] }
Parameters
- 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.
Examples
Successfully list flavors with details
Request
GET /flavors/detail Authorization: Basic {Base64-encoded username:password string}
Response
200 OK { "flavors":[ { "name":"Small", "links":[ {"href":"https://api.hostway.com/flavors/1/", "rel":"self"} ], "vcpu":1, "ram":512, "disk":10, "id":"1" }, { "name":"Large", "links":[ {"href":"https://api.hostway.com/flavors/2/", "rel":"self"} ], "vcpu":4, "ram":16384, "disk":60, "id":"2" } ] }
Failure while trying to make an unauthorized request
Request
GET /flavors/detail Authorization: Basic {invalid authorization}
Response
401 Unauthorized
See also