ImageList

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
This operation will list all available images.
+
This operation will list all images.
  
=='''GET''' /images==
+
='''GET''' /images?''name=imageName&status=imageStatus&type=imageType&zone=zoneTextKey''=
 +
 
 +
== 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'' Zone textkey of the image to search for.
  
=== Parameters ===
 
No parameters
 
  
=== Result ===
+
== Result ==
==== JSON ====
+
=== JSON ===
 
  <nowiki>
 
  <nowiki>
 
{
 
{
Line 23: Line 34:
 
             }
 
             }
 
         ],
 
         ],
         "id":"{image_id}"
+
         "id": "{image_id}",
 +
        "zones": ["{zone_textkey}", "{zone_textkey2}"]
 
       },
 
       },
 
       {
 
       {
Line 37: Line 49:
 
             }
 
             }
 
         ],
 
         ],
         "id":"{image_id}"
+
         "id":"{image_id}",
 +
        "zones": ["{zone_textkey}"]
 
       }
 
       }
 
   ]
 
   ]
Line 52: Line 65:
 
: Display name for this image.
 
: Display name for this image.
  
=== Response Codes ===
+
; zones - ''string''
 +
: Zones
 +
 
 +
== Response Codes ==
 
; Success: HTTP/1.1 200 OK
 
; 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.
 
; 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 ===
+
== Examples ==
 
'''Successfully list images'''
 
'''Successfully list images'''
 
:'''GET''' {api_server}/images
 
:'''GET''' {api_server}/images
Line 85: Line 101:
 
                 }
 
                 }
 
             ],  
 
             ],  
             "id": "123"
+
             "id": "123",
 +
            "zones": ["AUS001"]
 
           },  
 
           },  
 
           {
 
           {
Line 99: Line 116:
 
                 }
 
                 }
 
               ],  
 
               ],  
               "id": "290"
+
               "id": "290",
 +
              "zones": ["AUS001"]
 
           },
 
           },
 
           {
 
           {
Line 113: Line 131:
 
                   }
 
                   }
 
               ],  
 
               ],  
               "id": "233"
+
               "id": "233",
 +
              "zones": ["AUS001"]
 
           }
 
           }
 
       ]
 
       ]
Line 140: Line 159:
 
[[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 08:08, 20 May 2013

This operation will list all images.

Contents

GET /images?name=imageName&status=imageStatus&type=imageType&zone=zoneTextKey

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 Zone textkey of the image to search for.


Result

JSON

{
   "images":[
      {
         "name":"{display_image_name}",
         "links":[
            {
               "href":"http://{api_server}/images/{image_id}/",
               "rel":"self"
            },
            {
               "href":"http://{api_server}/images/{image_id}/",
               "rel":"bookmark"
            }
         ],
         "id": "{image_id}",
         "zones": ["{zone_textkey}", "{zone_textkey2}"]
      },
      {
         "name":"{display_image_name}",
         "links":[
            {
               "href":"http://{api_server}/images/{image_id}/",
               "rel":"self"
            },
            {
               "href":"http://{api_server}/images/{image_id}/",
               "rel":"bookmark"
            }
         ],
         "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.
zones - string
Zones

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

Successfully 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": "test_public_image", 
             "links": [
                {
                   "href": "http://{api_server}/images/123/", 
                   "rel": "self"
                }, 
                {
                   "href": "http://{api_server}/images/123/", 
                   "rel": "bookmark"
                }
             ], 
             "id": "123",
             "zones": ["AUS001"]
          }, 
          {
             "name": "test_debian_image", 
             "links": [
                 {
                    "href": "http://{api_server}/images/290/", 
                    "rel": "self"
                 }, 
                 {
                    "href": "http://{api_server}/images/290/", 
                    "rel": "bookmark"
                 }
              ], 
              "id": "290",
              "zones": ["AUS001"]
          },
          {
              "name": "test_private_image", 
              "links":  [
                  {
                     "href": "http://{api_server}/images/233/", 
                     "rel": "self"
                  },
                  {
                     "href": "http://{api_server}/images/233/", 
                     "rel": "bookmark"
                  }
              ], 
              "id": "233",
              "zones": ["AUS001"]
           }
       ]
    }


Failure while trying to make an unauthorized request

GET {api_server}/images

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.
Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox