Flavor
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | = GET /flavors/detail/''{id}'' = | + | = GET /accounts/''{accountId}''/flexcloud/flavors/detail/''{id}'' = |
This operation will return size details of a single flavor. | This operation will return size details of a single flavor. | ||
__TOC__ | __TOC__ | ||
== Request == | == Request == | ||
− | <code>GET /flavors/detail/''{id}''</code> | + | <code>GET /accounts/''{accountId}''/flexcloud/flavors/detail/''{id}''</code> |
=== Parameters === | === Parameters === | ||
+ | ; accountId - ''string'' | ||
+ | : The selected account Id. | ||
+ | |||
; id | ; id | ||
: The unique identifier of the flavor to be retrieved. ''Note see warnings in [[Hypermedia]]''. | : The unique identifier of the flavor to be retrieved. ''Note see warnings in [[Hypermedia]]''. | ||
Line 30: | Line 33: | ||
"name":"{display_flavor_name}", | "name":"{display_flavor_name}", | ||
"links":[ | "links":[ | ||
− | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/flavors/{flavor_id}/", "rel":"self"} | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"} |
], | ], | ||
"vcpu":"1", | "vcpu":"1", | ||
Line 37: | Line 40: | ||
"id":"{flavor_id}" | "id":"{flavor_id}" | ||
} | } | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
==== Parameters ==== | ==== Parameters ==== | ||
Line 64: | Line 66: | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /flavors/1 | + | GET /accounts/{accountId}/flexcloud/flavors/1 |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 76: | 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"} |
], | ], | ||
"vcpu":"1", | "vcpu":"1", | ||
Line 83: | Line 84: | ||
"id":"1" | "id":"1" | ||
} | } | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
=== Failure while trying to make an unauthorized request === | === Failure while trying to make an unauthorized request === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /flavors/1 | + | GET /accounts/{accountId}/flexcloud/flavors/1 |
− | Authorization: Basic {invalid authorization} | + | Authorization: Basic {invalid authorization}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
<nowiki> | <nowiki> | ||
− | 401 Unauthorized | + | 401 Unauthorized</nowiki> |
− | + | ||
=== Failure while trying to access a flavor that is not allowed for this user === | === Failure while trying to access a flavor that is not allowed for this user === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /flavors/101 | + | GET /accounts/{accountId}/flexcloud/flavors/101 |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string}</nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 116: | Line 113: | ||
"errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | ||
} | } | ||
− | } | + | }</nowiki> |
− | + | ||
=== Failure while trying to access a flavor that does not exist === | === Failure while trying to access a flavor that does not exist === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /flavors/missing_flavor_id | + | GET /accounts/{accountId}/flexcloud/flavors/missing_flavor_id |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string} </nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 137: | Line 132: | ||
"errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | ||
} | } | ||
− | } | + | } </nowiki> |
− | </nowiki> | + | |
+ | === Account not found === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /accounts/fake/flexcloud/flavors/101 | ||
+ | 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> | ||
+ | |||
+ | == Alternative URI /flavors/detail/{id} == | ||
+ | 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 /flavors/detail/{id}</code> | ||
== See also == | == See also == |
Latest revision as of 11:00, 11 October 2013
GET /accounts/{accountId}/flexcloud/flavors/detail/{id}
This operation will return size details of a single flavor.
Contents |
Request
GET /accounts/{accountId}/flexcloud/flavors/detail/{id}
Parameters
- accountId - string
- The selected account Id.
- id
- The unique identifier of the flavor to be retrieved. Note see warnings in Hypermedia.
Response
Status Code
- 200 OK
- Success
- 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.
- 403 Forbidden
- The resource cannot be accessed by the user
- 404 Not Found
- The requested resource does not exist
Response Body
{ "flavor":{ "name":"{display_flavor_name}", "links":[ {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/{flavor_id}/", "rel":"self"} ], "vcpu":"1", "ram":512, "disk":10, "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 view flavor details
Request
GET /accounts/{accountId}/flexcloud/flavors/1 Authorization: Basic {Base64-encoded username:password string}
Response
200 OK { "flavor":{ "name":"Small", "links":[ {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/flavors/1/", "rel":"self"} ], "vcpu":"1", "ram":512, "disk":10, "id":"1" } }
Failure while trying to make an unauthorized request
Request
GET /accounts/{accountId}/flexcloud/flavors/1 Authorization: Basic {invalid authorization}
Response
401 Unauthorized
Failure while trying to access a flavor that is not allowed for this user
Request
GET /accounts/{accountId}/flexcloud/flavors/101 Authorization: Basic {Base64-encoded username:password string}
Response
403 Forbidden { "forbidden": { "message": "forbidden", "code": 403, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
Failure while trying to access a flavor that does not exist
Request
GET /accounts/{accountId}/flexcloud/flavors/missing_flavor_id Authorization: Basic {Base64-encoded username:password string}
Response
404 Not Found { "itemNotFound": { "message": "Resource not found", "code": 404, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
Account not found
Request
GET /accounts/fake/flexcloud/flavors/101 Authorization: Basic {Base64-encoded username:password string}
Response
{ "itemNotFound": { "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c", "message": "Resource not found", "code": 404, "details": "" } }
Alternative URI /flavors/detail/{id}
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 /flavors/detail/{id}
See also