FlavorList
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | = GET /flavors?minDisk=''{diskInGB}''&minRam=''{ramInMB}'' = | + | = GET /accounts/''{accountId}''/flexcloud/flavors?minDisk=''{diskInGB}''&minRam=''{ramInMB}'' = |
Lists all available flavors optionally limited by the query parameters. | Lists all available flavors optionally limited by the query parameters. | ||
__TOC__ | __TOC__ | ||
== Request == | == Request == | ||
− | <code>GET /flavors?minDisk=''{diskInGB}''&minRam=''{ramInMB}''</code> | + | <code>GET /accounts/''{accountId}''/flexcloud/flavors?minDisk=''{diskInGB}''&minRam=''{ramInMB}''</code> |
=== URI Parameters === | === URI Parameters === | ||
+ | ; accountId - ''string'' | ||
+ | : The selected account Id. | ||
+ | |||
; minDisk - ''int'' | ; minDisk - ''int'' | ||
: ''Optional'' Only flavors with a disk size greater than or equal to minDisk will be returned. Specified in GB. | : ''Optional'' Only flavors with a disk size greater than or equal to minDisk will be returned. Specified in GB. | ||
Line 22: | Line 25: | ||
; 401 Unauthorized | ; 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. | : 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. | ||
+ | |||
+ | ; 404 Not Found | ||
+ | : Failure - Resource does not exists | ||
=== Response Body === | === Response Body === | ||
Line 30: | Line 36: | ||
"id":"{flavor_id}", | "id":"{flavor_id}", | ||
"links":[ | "links":[ | ||
− | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/{flavor_id}/", "rel":"self"} | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"} |
], | ], | ||
"name":"{display_flavor_name}" | "name":"{display_flavor_name}" | ||
Line 37: | Line 43: | ||
"id":"{flavor_id}", | "id":"{flavor_id}", | ||
"links":[ | "links":[ | ||
− | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/{flavor_id}/", "rel":"self"} | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"} |
], | ], | ||
"name":"{display_flavor_name}" | "name":"{display_flavor_name}" | ||
} | } | ||
] | ] | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
==== Parameters ==== | ==== Parameters ==== | ||
Line 60: | Line 65: | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /flavors | + | GET /accounts/{accountId}/flexcloud/flavors |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 73: | Line 77: | ||
"name": "Small", | "name": "Small", | ||
"links": [ | "links": [ | ||
− | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/flavors/1/", "rel": "self"}, | + | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/1/", "rel": "self"}, |
− | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/flavors/1/", "rel": "bookmark"} | + | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/1/", "rel": "bookmark"} |
], | ], | ||
"id": "1" | "id": "1" | ||
Line 81: | Line 85: | ||
"name": "Large", | "name": "Large", | ||
"links": [ | "links": [ | ||
− | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/flavors/3/", "rel": "self"}, | + | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/3/", "rel": "self"}, |
− | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/flavors/3/", "rel": "bookmark"} | + | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/3/", "rel": "bookmark"} |
], | ], | ||
"id": "3" | "id": "3" | ||
} | } | ||
] | ] | ||
− | } | + | }</nowiki> |
− | + | ||
=== Failure while trying to make an unauthorized request === | === Failure while trying to make an unauthorized request === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /flavors | + | GET /accounts/{accountId}/flexcloud/flavors |
− | Authorization: Basic {invalid authorization} | + | Authorization: Basic {invalid authorization}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
<nowiki> | <nowiki> | ||
− | 401 Unauthorized | + | 401 Unauthorized</nowiki> |
− | </nowiki> | + | |
+ | === Account not found === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /accounts/fake/flexcloud/flavors | ||
+ | Authorization: Basic {Base64-encoded username:password string}</nowiki> | ||
+ | |||
+ | '''Response''' | ||
+ | <nowiki> | ||
+ | { | ||
+ | "itemNotFound": { | ||
+ | "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c", | ||
+ | "message": "Resource not found", | ||
+ | "code": 404, | ||
+ | "details": "" | ||
+ | } | ||
+ | }</nowiki> | ||
== See also == | == See also == | ||
* [[FlexCloud Server|FlexCloud Server API]] | * [[FlexCloud Server|FlexCloud Server API]] | ||
* [[Common Features]] | * [[Common Features]] | ||
+ | |||
+ | == Alternative URI /flavors == | ||
+ | An alternative way to execute this call is to omit the ''accountId'' portion of the URI. In this case the system assumes the request is executed for the account identified in the [[Authentication|authorization header]]. | ||
+ | |||
+ | <code>GET /accounts/{accountId}/flexcloud/flavors</code> | ||
{{disqus}} | {{disqus}} | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:FlexCloud Server API]] | [[Category:FlexCloud Server API]] |
Latest revision as of 12:00, 11 October 2013
[edit] GET /accounts/{accountId}/flexcloud/flavors?minDisk={diskInGB}&minRam={ramInMB}
Lists all available flavors optionally limited by the query parameters.
Contents |
[edit] Request
GET /accounts/{accountId}/flexcloud/flavors?minDisk={diskInGB}&minRam={ramInMB}
[edit] URI Parameters
- accountId - string
- The selected account Id.
- minDisk - int
- Optional Only flavors 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
[edit] Response
[edit] 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.
- 404 Not Found
- Failure - Resource does not exists
[edit] Response Body
{ "flavors":[ { "id":"{flavor_id}", "links":[ {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"} ], "name":"{display_flavor_name}" }, { "id":"{flavor_id}", "links":[ {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"} ], "name":"{display_flavor_name}" } ] }
[edit] Parameters
- id - string
- Unique identifier for this flavor.
- links - array
- Hypermedia for this resource.
- name - string
- Display name for this flavor.
[edit] Examples
[edit] Successfully list available flavors
Request
GET /accounts/{accountId}/flexcloud/flavors Authorization: Basic {Base64-encoded username:password string}
Response
200 OK { "flavors": [ { "name": "Small", "links": [ {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/1/", "rel": "self"}, {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/1/", "rel": "bookmark"} ], "id": "1" }, { "name": "Large", "links": [ {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/3/", "rel": "self"}, {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/3/", "rel": "bookmark"} ], "id": "3" } ] }
[edit] Failure while trying to make an unauthorized request
Request
GET /accounts/{accountId}/flexcloud/flavors Authorization: Basic {invalid authorization}
Response
401 Unauthorized
[edit] Account not found
Request
GET /accounts/fake/flexcloud/flavors Authorization: Basic {Base64-encoded username:password string}
Response
{ "itemNotFound": { "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c", "message": "Resource not found", "code": 404, "details": "" } }
[edit] See also
[edit] Alternative URI /flavors
An alternative way to execute this call is to omit the accountId portion of the URI. In this case the system assumes the request is executed for the account identified in the authorization header.
GET /accounts/{accountId}/flexcloud/flavors