ImageList

(Difference between revisions)
Jump to: navigation, search
Line 4: Line 4:
  
 
== Parameters ==
 
== Parameters ==
 +
No parameters
  
 
== Result ==
 
== Result ==
Line 11: Line 12:
 
   "images":[
 
   "images":[
 
       {
 
       {
         "name":"debian",
+
         "name":"{display_image_name}",
 
         "links":[
 
         "links":[
 
             {
 
             {
               "href":"http://127.0.0.1:6543/images/debian_lenny_template/",
+
               "href":"http://{server_name}/images/{image_id}/",
 
               "rel":"self"
 
               "rel":"self"
 
             },
 
             },
 
             {
 
             {
               "href":"http://127.0.0.1:6543/images/debian_lenny_template/",
+
               "href":"http://{server_name}/images/{image_id}/",
 
               "rel":"bookmark"
 
               "rel":"bookmark"
 
             }
 
             }
 
         ],
 
         ],
         "id":"debian_lenny_template"
+
         "id":"{image_id}"
 
       },
 
       },
 
       {
 
       {
         "name":"windows 2007",
+
         "name":"{display_image_name}",
 
         "links":[
 
         "links":[
 
             {
 
             {
               "href":"http://127.0.0.1:6543/images/vmi2011Dec26_2C7D8Dbur/",
+
               "href":"http://{server_name}/images/{image_id}/",
 
               "rel":"self"
 
               "rel":"self"
 
             },
 
             },
 
             {
 
             {
               "href":"http://127.0.0.1:6543/images/vmi2011Dec26_2C7D8Dbur/",
+
               "href":"http://{server_name}/images/{image_id}/",
 
               "rel":"bookmark"
 
               "rel":"bookmark"
 
             }
 
             }
 
         ],
 
         ],
         "id":"vmi2011Dec26_2C7D8Dbur"
+
         "id":"{image_id}"
 
       }
 
       }
 
   ]
 
   ]
Line 50: Line 51:
  
 
; name - ''string''
 
; name - ''string''
: Descriptive name for this image.
+
: Display name for this image.
 +
 
 +
== 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.
 +
 
 +
== Examples ==
 +
'''List images'''
 +
:'''GET''' {api_server}/images
 +
 
 +
''Request Headers:''
 +
    Content-Type:application/json
 +
    Charset=UTF-8
 +
    Authorization:Base64-encoded username & password string
 +
 
 +
''Response Code:''
 +
<pre>HTTP/1.1 200 OK</pre>
 +
 
 +
''Response Body:''
 +
<big><source lang="javascript">
 +
    {
 +
      "images": [
 +
          {
 +
            "name": "dimitrov_public_image",
 +
            "links": [
 +
                {
 +
                  "href": "http://{api_server}/images/vmi2011Nov08_2D2fLloqt/",
 +
                  "rel": "self"
 +
                },
 +
                {
 +
                  "href": "http://{api_server}/images/vmi2011Nov08_2D2fLloqt/",
 +
                  "rel": "bookmark"
 +
                }
 +
            ],
 +
            "id": "vmi2011Nov08_2D2fLloqt"
 +
          },
 +
          {
 +
            "name": "debian",
 +
            "links": [
 +
                {
 +
                    "href": "http://{api_server}/images/debian_lenny_template/",
 +
                    "rel": "self"
 +
                },
 +
                {
 +
                    "href": "http://{api_server}/images/debian_lenny_template/",
 +
                    "rel": "bookmark"
 +
                }
 +
              ],
 +
              "id": "debian_lenny_template"
 +
          },
 +
          {
 +
            "name": "test by shimde",
 +
            "links": [
 +
                {
 +
                    "href": "http://{api_server}/images/vmi2011Dec26_2C7D8Dbur/",
 +
                    "rel": "self"
 +
                },
 +
                {
 +
                    "href": "http://{api_server}/images/vmi2011Dec26_2C7D8Dbur/",
 +
                    "rel": "bookmark"
 +
                }
 +
              ],
 +
              "id": "vmi2011Dec26_2C7D8Dbur"
 +
          },
 +
          {
 +
              "name": "jello_private_image",
 +
              "links":  [
 +
                  {
 +
                    "href": "http://{api_server}/images/vmi2011Nov08_xBHzvNEy8/",
 +
                    "rel": "self"
 +
                  },
 +
                  {
 +
                    "href": "http://{api_server}/images/vmi2011Nov08_xBHzvNEy8/",
 +
                    "rel": "bookmark"}],
 +
              "id": "vmi2011Nov08_xBHzvNEy8"
 +
          }
 +
      ]
 +
    }
 +
</source></big>
 +
 
 +
 
 +
'''Unauthorized request'''
 +
:'''GET''' {server_name}/images
 +
 
 +
''Request Headers:''
 +
    Content-Type:application/json
 +
 
 +
''Response Code:''
 +
<pre>HTTP/1.1 401 Unauthorized</pre>
 +
 
 +
''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.
 +
 
  
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
 
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->

Revision as of 19:22, 12 April 2012

This operation will list all images.

GET /images

Contents

Parameters

No parameters

Result

JSON

{
   "images":[
      {
         "name":"{display_image_name}",
         "links":[
            {
               "href":"http://{server_name}/images/{image_id}/",
               "rel":"self"
            },
            {
               "href":"http://{server_name}/images/{image_id}/",
               "rel":"bookmark"
            }
         ],
         "id":"{image_id}"
      },
      {
         "name":"{display_image_name}",
         "links":[
            {
               "href":"http://{server_name}/images/{image_id}/",
               "rel":"self"
            },
            {
               "href":"http://{server_name}/images/{image_id}/",
               "rel":"bookmark"
            }
         ],
         "id":"{image_id}"
      }
   ]
}


id - string
Unique identifier for this image.
links - array
Hypermedia for this resource.
name - string
Display name for this image.

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.

Examples

List images

GET {api_server}/images

Request Headers:

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

Response Code:

HTTP/1.1 200 OK

Response Body:

     {
       "images": [
          {
             "name": "dimitrov_public_image", 
             "links": [
                {
                   "href": "http://{api_server}/images/vmi2011Nov08_2D2fLloqt/", 
                   "rel": "self"
                }, 
                {
                   "href": "http://{api_server}/images/vmi2011Nov08_2D2fLloqt/", 
                   "rel": "bookmark"
                }
             ], 
             "id": "vmi2011Nov08_2D2fLloqt"
          }, 
          {
             "name": "debian", 
             "links": [
                 {
                    "href": "http://{api_server}/images/debian_lenny_template/", 
                    "rel": "self"
                 }, 
                 {
                    "href": "http://{api_server}/images/debian_lenny_template/", 
                    "rel": "bookmark"
                 }
              ], 
              "id": "debian_lenny_template"
          }, 
          {
             "name": "test by shimde", 
             "links": [
                 {
                    "href": "http://{api_server}/images/vmi2011Dec26_2C7D8Dbur/", 
                    "rel": "self"
                 }, 
                 {
                    "href": "http://{api_server}/images/vmi2011Dec26_2C7D8Dbur/", 
                    "rel": "bookmark"
                 }
              ], 
              "id": "vmi2011Dec26_2C7D8Dbur"
          }, 
          {
              "name": "jello_private_image", 
              "links":  [
                  {
                     "href": "http://{api_server}/images/vmi2011Nov08_xBHzvNEy8/", 
                     "rel": "self"
                  },
                  {
                     "href": "http://{api_server}/images/vmi2011Nov08_xBHzvNEy8/", 
                     "rel": "bookmark"}], 
              "id": "vmi2011Nov08_xBHzvNEy8"
           }
       ]
    }


Unauthorized request

GET {server_name}/images

Request Headers:

   Content-Type:application/json

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.


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox