Image
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 /images/''{id}'' = | + | = GET /accounts/''{accountId}''/flexcloud/images/''{id}'' = |
Returns details for a single image. | Returns details for a single image. | ||
__TOC__ | __TOC__ | ||
== Request == | == Request == | ||
− | <code>GET /images/''{id}''</code> | + | <code>GET /accounts/''{accountId}''/flexcloud/images/''{id}''</code> |
=== Parameters === | === Parameters === | ||
+ | ; accountId | ||
+ | : The selected account Id. | ||
+ | |||
; id | ; id | ||
: The unique identifier of the image to be retrieved. ''Note see warnings in [[Hypermedia]]''. | : The unique identifier of the image to be retrieved. ''Note see warnings in [[Hypermedia]]''. | ||
Line 32: | Line 35: | ||
"name":"{display_image_name}", | "name":"{display_image_name}", | ||
"links":[ | "links":[ | ||
− | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"self"}, | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"}, |
− | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"bookmark"} | + | {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"bookmark"} |
], | ], | ||
"created":"yyyy-mm-ddThh:mm:ss", | "created":"yyyy-mm-ddThh:mm:ss", | ||
Line 39: | Line 42: | ||
"zones":["{zone_id}"] | "zones":["{zone_id}"] | ||
} | } | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
==== Parameters ==== | ==== Parameters ==== | ||
Line 72: | Line 74: | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /images/133 | + | GET /accounts/{accountId}/flexcloud/images/133 |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string} </nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 86: | Line 87: | ||
"name": "test_debian_image", | "name": "test_debian_image", | ||
"links": [ | "links": [ | ||
− | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/133/", "rel": "self"}, | + | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/133/", "rel": "self"}, |
− | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/133/", "rel": "bookmark"} | + | {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/133/", "rel": "bookmark"} |
], | ], | ||
"created": "2011-09-30T02:38:57", | "created": "2011-09-30T02:38:57", | ||
Line 93: | Line 94: | ||
"zones": ["AUS001"] | "zones": ["AUS001"] | ||
} | } | ||
− | } | + | }</nowiki> |
− | </nowiki> | + | |
=== Failure while trying to make an unauthorized request === | === Failure while trying to make an unauthorized request === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /images/133 | + | GET /accounts/{accountId}/flexcloud/images/133 |
− | Authorization: Basic {invalid authorization} | + | Authorization: Basic {invalid authorization} </nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
<nowiki> | <nowiki> | ||
− | 401 Unauthorized | + | 401 Unauthorized </nowiki> |
− | + | ||
=== Permission denied failure === | === Permission denied failure === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /images/122 | + | GET /accounts/{accountId}/flexcloud/images/122 |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string} </nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 126: | Line 123: | ||
"errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | ||
} | } | ||
− | } | + | } </nowiki> |
− | + | ||
=== Failure while trying to request for an image that does not exist === | === Failure while trying to request for an image that does not exist === | ||
'''Request''' | '''Request''' | ||
<nowiki> | <nowiki> | ||
− | GET /images/missing_image_id | + | GET /accounts/{accountId}/flexcloud/images/missing_image_id |
− | Authorization: Basic {Base64-encoded username:password string} | + | Authorization: Basic {Base64-encoded username:password string} </nowiki> |
− | + | ||
'''Response''' | '''Response''' | ||
Line 147: | Line 142: | ||
"errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" | ||
} | } | ||
− | } | + | } </nowiki> |
− | </nowiki> | + | |
+ | |||
+ | === Account Number not found === | ||
+ | '''Request''' | ||
+ | <nowiki> | ||
+ | GET /accounts/fake/flexcloud/images/122 | ||
+ | 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 /images/{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 /images/{id}</code> | ||
== See also == | == See also == |
Latest revision as of 12:00, 11 October 2013
[edit] GET /accounts/{accountId}/flexcloud/images/{id}
Returns details for a single image.
Contents |
[edit] Request
GET /accounts/{accountId}/flexcloud/images/{id}
[edit] Parameters
- accountId
- The selected account Id.
- id
- The unique identifier of the image to be retrieved. Note see warnings in Hypermedia.
[edit] Response
[edit] 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 is forbidden for this user
- 404 Not Found
- The resource does not exist
[edit] Response Body
{ "image":{ "status":"SAVING", "updated":null, "name":"{display_image_name}", "links":[ {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"}, {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"bookmark"} ], "created":"yyyy-mm-ddThh:mm:ss", "id":"{image_id}", "zones":["{zone_id}"] } }
[edit] Parameters
- id - string
- Unique identifier for this image.
- links - array
- Hypermedia for this resource.
- name - string
- Display name for this image.
- status - string
- Current state of this image. Valid values are ACTIVE, SAVING, DELETED.
- ACTIVE - Image is ready to be used.
- SAVING - Image is being uploaded or saved from a running Server instance.
- DELETED - Image was recently deleted or is in the process of being deleted.
- created - string
- The date and time the image was created. ISO 8601 format, YYYY-MM-DDTHH:MM:SS.
- updated
- Unused always null.
- zones - string
- Zones where the image is available.
[edit] Examples
[edit] Successfully view image
Request
GET /accounts/{accountId}/flexcloud/images/133 Authorization: Basic {Base64-encoded username:password string}
Response
200 OK { "image": { "status": "SAVING", "updated": null, "name": "test_debian_image", "links": [ {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/images/133/", "rel": "self"}, {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/images/133/", "rel": "bookmark"} ], "created": "2011-09-30T02:38:57", "id": "133", "zones": ["AUS001"] } }
[edit] Failure while trying to make an unauthorized request
Request
GET /accounts/{accountId}/flexcloud/images/133 Authorization: Basic {invalid authorization}
Response
401 Unauthorized
[edit] Permission denied failure
Request
GET /accounts/{accountId}/flexcloud/images/122 Authorization: Basic {Base64-encoded username:password string}
Response
403 Forbidden { "forbidden": { "message": "forbidden", "code": 403, "details": "", "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf" } }
[edit] Failure while trying to request for an image that does not exist
Request
GET /accounts/{accountId}/flexcloud/images/missing_image_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" } }
[edit] Account Number not found
Request
GET /accounts/fake/flexcloud/images/122 Authorization: Basic {Base64-encoded username:password string}
Response
{ "itemNotFound": { "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c", "message": "Resource not found", "code": 404, "details": "" } }
[edit] Alternative URI /images/{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 /images/{id}
[edit] See also