Image

From Hostway API Documentation
Revision as of 13:46, 24 May 2013 by Mike.robski (Talk | contribs)
Jump to: navigation, search

GET /images/{id}

Returns details for a single image.

Contents

Request

GET /images/{id}

Parameters

id
The unique identifier of the image 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 is forbidden for this user
404 Not Found
The resource does not exist

Response Body

{
  "image":{
    "status":"SAVING",
    "updated":null,
    "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"}
    ],
    "created":"yyyy-mm-ddThh:mm:ss",
    "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.
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.

Examples

Successfully view image

Request

GET /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/images/133/", "rel": "self"},
      {"href": "https://api.hostway.com/images/133/", "rel": "bookmark"}
    ],
    "created": "2011-09-30T02:38:57", 
    "id": "133",
    "zones": ["AUS001"]
  }
}

Failure while trying to make an unauthorized request

Request

GET /images/133
Authorization: Basic {invalid authorization}
 

Response

401 Unauthorized
 

Permission denied failure

Request

GET /images/122
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 request for an image that does not exist

Request

GET /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"
  }
}
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox