Image

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
This operation will return details of a single image.
 
This operation will return details of a single image.
  
=='''GET''' /images/'''id'''==
+
'''GET''' /images/'''id'''
  
=== Parameters ===
+
== Parameters ==
 
; 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]]''.
  
=== Result ===
+
== Result ==
==== JSON ====
+
=== JSON ===
 
  <nowiki>
 
  <nowiki>
 
{
 
{
Line 26: Line 26:
 
       ],
 
       ],
 
       "created":"2011-09-30T02:38:57",
 
       "created":"2011-09-30T02:38:57",
       "id":"{image_id}"
+
       "id":"{image_id}",
 +
      "zones": ["{zone_textkey}"]
 
   }
 
   }
 
}
 
}
Line 52: Line 53:
 
: Unused always null.
 
: Unused always null.
  
=== Response Codes ===
+
; zones - ''string''
 +
: Zone textkey
 +
 
 +
== Response Codes ==
 
; Success:
 
; Success:
 
:''HTTP/1.1 200 OK''
 
:''HTTP/1.1 200 OK''
Line 61: Line 65:
 
:''HTTP/1.1 404 Not Found'' - The resource does not exist
 
:''HTTP/1.1 404 Not Found'' - The resource does not exist
  
=== Examples ===
+
== Examples ==
 
'''Successfully view image'''
 
'''Successfully view image'''
 
:'''GET''' <nowiki>http://{api_server}/images/133</nowiki>
 
:'''GET''' <nowiki>http://{api_server}/images/133</nowiki>
Line 92: Line 96:
 
           ],  
 
           ],  
 
           "created": "2011-09-30T02:38:57",  
 
           "created": "2011-09-30T02:38:57",  
           "id": "133"
+
           "id": "133",
 +
          "zones": ["AUS001"]
 
       }
 
       }
 
  }
 
  }
Line 132: Line 137:
 
           "message": "forbidden",  
 
           "message": "forbidden",  
 
           "code": 403,  
 
           "code": 403,  
           "details": ""
+
           "details": "",
 +
          "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
       }
 
       }
 
  }
 
  }
Line 153: Line 159:
 
           "message": "Resource not found",  
 
           "message": "Resource not found",  
 
           "code": 404,  
 
           "code": 404,  
           "details": ""
+
           "details": "",
 +
          "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 
       }
 
       }
 
  }
 
  }
Line 159: Line 166:
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
 
{{#widget:DISQUS
 
|id=hostway
 
|uniqid={{PAGENAME}}
 
|url={{fullurl:{{PAGENAME}}}}
 
}}
 
 
<!--  ########################################################################### -->
 

Revision as of 07:09, 20 May 2013

This operation will return details of a single image.

GET /images/id

Contents

Parameters

id
The unique identifier of the image to be retrieved. Note see warnings in Hypermedia.

Result

JSON

{
   "image":{
      "status":"SAVING",
      "updated":null,
      "name":"{display_image_name}",
      "links":[
         {
            "href":"http://{api_server}/images/{image_id}/",
            "rel":"self"
         },
         {
            "href":"http://{api_server}/images/{image_id}/",
            "rel":"bookmark"
         }
      ],
      "created":"2011-09-30T02:38:57",
      "id":"{image_id}",
      "zones": ["{zone_textkey}"]
   }
}

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
Zone textkey

Response Codes

Success
HTTP/1.1 200 OK
Failure
HTTP/1.1 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.
HTTP/1.1 403 Forbidden - The resource is forbidden for this user
HTTP/1.1 404 Not Found - The resource does not exist

Examples

Successfully view image

GET http://{api_server}/images/133

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 200 OK

Response Body:

 {
    "image": 
       {
          "status": "SAVING", 
          "updated": null, 
          "name": "test_debian_image", 
          "links": [
             {
                "href": "http://{api_server}/images/133/", 
                "rel": "self"
             },
             {
                "href": "http://{api_server}/images/133/", 
                "rel": "bookmark"
             }
          ], 
          "created": "2011-09-30T02:38:57", 
          "id": "133",
          "zones": ["AUS001"]
       }
 }

Failure while trying to make an unauthorized request

GET http://{api_server}/images/{image_id}

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded fake_authentication_string

Response Code:

HTTP/1.1 401 Unauthorized

Response Body:

    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.

Permission denied failure

GET http(s)://{api_server}/images/{image_id}

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 403 Forbidden

Response Body:

{
   "forbidden": 
      {
         "message": "forbidden", 
         "code": 403, 
         "details": "",
         "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
      }
}

Failure while trying to request for an image that does not exist

GET http(s)://{api_server}/images/{fake_image_id}

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 404 Not Found

Response Body:

{
   "itemNotFound": 
      {
         "message": "Resource not found", 
         "code": 404, 
         "details": "",
         "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
      }
}
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox