ImageList
From Hostway API Documentation
Revision as of 18:53, 26 June 2013 by Administrator (Talk | contribs)
GET /images?name={imageName}&status={imageStatus}&type={imageType}&zone={zoneId}
This operation will list all images.
Contents |
Request
GET /images?name={imageName}&status={imageStatus}&type={imageType}&zone={zoneId}
Parameters
- name - string
- Optional image name to search for.
- status - string
- Optional Image status to search for. Values: ACTIVE, SAVING, DELETED.
- type - string
- Optional type of the image to search for. Values: BASE, SERVER.
- zone - string
- Optional the zone where the image is available.
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
{ "images":[ { "name":"{display_image_name}", "links":[ {"href":"https://api.hostway.com/images/{image_id}/", "rel":"self"}, {"href":"https://api.hostway.com/images/{image_id}/", "rel":"bookmark"} ], "id": "{image_id}", "zones": ["{zone_id_1}", "{zone_id_2}"] }, { "name":"{display_image_name}", "links":[ {"href":"https://api.hostway.com/images/{image_id}/", "rel":"self"}, {"href":"https://api.hostway.com/images/{image_id}/", "rel":"bookmark"} ], "id":"{image_id}", "zones": ["{zone_id}"] } ] }
Parameters
- id - string
- Unique identifier for this image.
- links - array
- Hypermedia for this resource.
- name - string
- Display name for this image.
- zones - string
- Zones where the image is available.
Examples
Successfully list images
Request
GET /images Authorization: Basic {Base64-encoded username:password string}
Response
200 OK { "images": [ { "name": "test_public_image", "links": [ {"href": "https://api.hostway.com/images/123/", "rel": "self"}, {"href": "https://api.hostway.com/images/123/", "rel": "bookmark"} ], "id": "123", "zones": ["AUS001"] }, { "name": "test_debian_image", "links": [ {"href": "https://api.hostway.com/images/290/", "rel": "self"}, {"href": "https://api.hostway.com/images/290/", "rel": "bookmark"} ], "id": "290", "zones": ["AUS001"] }, { "name": "test_private_image", "links": [ {"href": "https://api.hostway.com/images/233/", "rel": "self"}, {"href": "https://api.hostway.com/images/233/", "rel": "bookmark"} ], "id": "233", "zones": ["AUS001"] } ] }
Failure while trying to make an unauthorized request
Request
GET /images Authorization: Basic {invalid authorization}
Response
401 Unauthorized
See also