ImageList

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
This operation will list all images.
+
= GET /images?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}'' =
 +
Lists all images.
 +
__TOC__
 +
== Request ==
 +
<code>GET /images?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}''</code>
  
='''GET''' /images?''name=imageName&status=imageStatus&type=imageType&zone=zoneTextKey''=
+
=== Parameters ===
 
+
== Parameters ==
+
 
; name - ''string''
 
; name - ''string''
 
: ''Optional'' image name to search for.
 
: ''Optional'' image name to search for.
  
 
; status - ''string''
 
; status - ''string''
: ''Optional'' Image status to search for. Values: '''ACTIVE''', '''SAVING''', '''DELETED'''
+
: ''Optional'' Image status to search for. Values: '''ACTIVE''', '''SAVING''', '''DELETED'''.
  
 
; type - ''string''
 
; type - ''string''
: ''Optional'' type of the image to search for. Values: '''BASE''', '''SERVER'''
+
: ''Optional'' type of the image to search for. Values: '''BASE''', '''SERVER'''.
  
 
; zone - ''string''
 
; zone - ''string''
: ''Optional'' Zone textkey of the image to search for.
+
: ''Optional'' the zone where the image is available.
  
 +
== Response ==
  
== Result ==
+
=== Status Code ===
=== JSON ===
+
; 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 ===
 
  <nowiki>
 
  <nowiki>
 
{
 
{
  "images":[
+
  "images":[
      {
+
    {
        "name":"{display_image_name}",
+
      "name":"{display_image_name}",
        "links":[
+
      "links":[
            {
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"self"},
              "href":"http://{api_server}/images/{image_id}/",
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"bookmark"}
              "rel":"self"
+
      ],
            },
+
      "id": "{image_id}",
            {
+
      "zones": ["{zone_id_1}", "{zone_id_2}"]
              "href":"http://{api_server}/images/{image_id}/",
+
    },
              "rel":"bookmark"
+
    {
            }
+
      "name":"{display_image_name}",
        ],
+
      "links":[
        "id": "{image_id}",
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"self"},
        "zones": ["{zone_textkey}", "{zone_textkey2}"]
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"bookmark"}
      },
+
      ],
      {
+
      "id":"{image_id}",
        "name":"{display_image_name}",
+
      "zones": ["{zone_id}"]
        "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}"]
+
      }
+
  ]
+
 
}
 
}
 
</nowiki>
 
</nowiki>
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this image.
 
: Unique identifier for this image.
Line 66: Line 64:
  
 
; zones - ''string''
 
; zones - ''string''
: Zones
+
: Zones where the image is available.
 
+
== 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 ==
 
== Examples ==
'''Successfully list images'''
 
:'''GET''' {api_server}/images
 
  
''Request Headers:''
+
=== Successfully list images ===
    Content-Type:application/json
+
'''Request'''
    Charset=UTF-8
+
<nowiki>
    Authorization:Base64-encoded username & password string
+
GET /images
 +
Authorization: Basic {Base64-encoded username:password string}
 +
</nowiki>
  
''Response Code:''
+
'''Response'''
<pre>HTTP/1.1 200 OK</pre>
+
 
+
''Response Body:''
+
 
  <nowiki>
 
  <nowiki>
    {
+
200 OK
      "images": [
+
 
          {
+
{
            "name": "test_public_image",  
+
  "images": [
            "links": [
+
    {
                {
+
      "name": "test_public_image",  
                  "href": "http://{api_server}/images/123/",  
+
      "links": [
                  "rel": "self"
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/123/", "rel": "self"},
                },  
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/123/", "rel": "bookmark"}
                {
+
      ],  
                  "href": "http://{api_server}/images/123/",  
+
      "id": "123",
                  "rel": "bookmark"
+
      "zones": ["AUS001"]
                }
+
    },  
            ],  
+
    {
            "id": "123",
+
      "name": "test_debian_image",  
            "zones": ["AUS001"]
+
      "links": [
          },  
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/290/", "rel": "self"},
          {
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/290/", "rel": "bookmark"}
            "name": "test_debian_image",  
+
      ],  
            "links": [
+
      "id": "290",
                {
+
      "zones": ["AUS001"]
                    "href": "http://{api_server}/images/290/",  
+
    },
                    "rel": "self"
+
    {
                },  
+
      "name": "test_private_image",  
                {
+
      "links":  [
                    "href": "http://{api_server}/images/290/",  
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/233/", "rel": "self"},
                    "rel": "bookmark"
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/233/", "rel": "bookmark"}
                }
+
      ],  
              ],  
+
      "id": "233",
              "id": "290",
+
      "zones": ["AUS001"]
              "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"]
+
          }
+
      ]
+
 
     }
 
     }
 +
  ]
 +
}
 
</nowiki>
 
</nowiki>
  
 +
=== Failure while trying to make an unauthorized request ===
 +
'''Request'''
 +
<nowiki>
 +
GET /images
 +
Authorization: Basic {invalid authorization}
 +
</nowiki>
  
'''Failure while trying to make an unauthorized request'''
+
'''Response'''
:'''GET''' {api_server}/images
+
<nowiki>
 
+
401 Unauthorized
''Request Headers:''
+
</nowiki>
    Content-Type:application/json
+
    Charset=UTF-8
+
    Authorization:Base64-encoded <span style="color:red">fake_authentication_string</span>
+
 
+
''Response Code:''
+
<pre>HTTP/1.1 401 Unauthorized</pre>
+
  
''Response Body:''
+
== See also ==
    401 Unauthorized
+
* [[FlexCloud Server|FlexCloud Server API]]
    This server could not verify that you are authorized to
+
* [[Common Features]]
    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.
+
  
 +
{{disqus}}
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]

Revision as of 12:38, 24 May 2013

GET /images?name={imageName}&status={imageStatus}&type={imageType}&zone={zoneId}

Lists 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


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox