ImageListDetails

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 +
= GET /images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}'' =
 
This operation will list all images including their details.
 
This operation will list all images including their details.
 +
__TOC__
 +
== Request ==
 +
<code>GET /images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}''</code>
  
='''GET''' /images/detail?''name=imageName&status=imageStatus&type=imageType&zone=zoneTextKey''=
+
=== URI 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.
  
== Result ==
+
== Response ==
=== JSON ===
+
 
 +
=== 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 ===
 
  <nowiki>
 
  <nowiki>
 
{
 
{
  "images":[
+
  "images":[
      {
+
    {
        "status":"{status}",
+
      "status":"{status}",
        "updated":null,
+
      "updated":null,
        "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"
+
      ],
            },
+
      "created":"yyyy-mm-ddThh:mm:ss",
            {
+
      "id":"{image_id}",
              "href":"http://{api_server}/images/{image_id}/",
+
      "zones": ["{zone_id}"]
              "rel":"bookmark"
+
    },
            }
+
    {
        ],
+
      "status":"{status}",
        "created":"2011-09-30T02:38:57",
+
      "updated":null,
        "id":"{image_id}",
+
      "name":"{display_image_name}",
        "zones": ["{zone_textkey}"]
+
      "links":[
      },
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"self"},
      {
+
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"bookmark"}
        "status":"{status}",
+
      ],
        "updated":null,
+
      "created":"yyyy-mm-ddThh:mm:ss",
        "name":"{display_image_name}",
+
      "id":"{image_id}",
        "links":[
+
      "zones": ["{zone_id_1}", "{zone_id_2}"]
            {
+
    }
              "href":"http://{api_server}/images/{image_id}/",
+
  ]
              "rel":"self"
+
            },
+
            {
+
              "href":"http://{api_server}/images/{image_id}/",
+
              "rel":"bookmark"
+
            }
+
        ],
+
        "created":"2011-12-27T02:59:27",
+
        "id":"{image_id}",
+
        "zones": ["{zone_textkey}", "{zone_textkey2}"]
+
      }
+
  ]
+
 
}
 
}
 
</nowiki>
 
</nowiki>
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this image.
 
: Unique identifier for this image.
Line 72: Line 71:
 
; status - ''string''
 
; status - ''string''
 
: Current state of this image. Valid values are ACTIVE, SAVING, DELETED.
 
: Current state of this image. Valid values are ACTIVE, SAVING, DELETED.
: '''ACTIVE''' - Image is ready to be used.
+
:: '''ACTIVE''' - Image is ready to be used.
: '''SAVING''' - Image is being uploaded or saved from a running [[Server]] instance.
+
:: '''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.
+
:: '''DELETED''' - Image was recently deleted or is in the process of being deleted.
  
 
; created - ''string''
 
; created - ''string''
Line 83: Line 82:
  
 
; zones
 
; zones
: Zones textkeys
+
: 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 image details'''
 
:'''GET''' <nowiki>http://{api_server}/images/detail</nowiki>
 
  
''Request Headers:''
+
=== Successfully list image details ===
    Content-Type:application/json
+
'''Request'''
    Charset=UTF-8
+
<nowiki>
    Authorization:Base64-encoded username & password string
+
GET /images/detail
 +
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": [
 
     {
 
     {
      "images": [
+
      "status": "ACTIVE",  
          {
+
      "updated": null,  
            "status": "ACTIVE",  
+
      "name": "test_public_image",  
            "updated": null,  
+
      "links": [
            "name": "test_public_image",  
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/123/", "rel": "self"},
            "links": [
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/123/", "rel": "bookmark"}
                {
+
      ],
                  "href": "http://{api_server}/images/123/",  
+
      "created": "2011-11-09T03:19:48",  
                  "rel": "self"
+
      "id": "123",
                },  
+
      "zones": ["AUS001"]
                {
+
    },
                  "href": "http://{api_server}/images/123/",  
+
    {
                  "rel": "bookmark"
+
      "status": "SAVING",  
                }
+
      "updated": null,  
              ],  
+
      "name": "test_debian_image",  
              "created": "2011-11-09T03:19:48",  
+
      "links": [
              "id": "123",
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/233/", "rel": "self"},
              "zones": ["AUS001"]
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/233/", "rel": "bookmark"}
          },
+
      ],
          {
+
      "created": "2011-09-30T02:38:57",  
              "status": "SAVING",  
+
      "id": "233",
              "updated": null,  
+
      "zones": ["AUS001"]
              "name": "test_debian_image",  
+
    },  
              "links": [
+
    {
                {
+
      "status": "ACTIVE",  
                    "href": "http://{api_server}/images/233/",  
+
      "updated": null,  
                    "rel": "self"
+
      "name": "test_private_image",  
                },  
+
      "links": [
                {
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/145/", "rel": "self"},
                    "href": "http://{api_server}/images/233/",  
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/145/", "rel": "bookmark"}
                    "rel": "bookmark"
+
      ],
                }
+
      "created": "2011-11-09T03:19:01",  
              ],  
+
      "id": "145",
              "created": "2011-09-30T02:38:57",  
+
      "zones": ["AUS001"]
              "id": "233",
+
              "zones": ["AUS001"]
+
          },  
+
          {
+
              "status": "ACTIVE",  
+
              "updated": null,  
+
              "name": "test_private_image",  
+
              "links": [
+
                {
+
                    "href": "http://{api_server}/images/145/",  
+
                    "rel": "self"
+
                },  
+
                {
+
                    "href": "http://{api_server}/images/145/",  
+
                    "rel": "bookmark"
+
                }
+
              ],  
+
              "created": "2011-11-09T03:19:01",  
+
              "id": "145",
+
              "zones": ["AUS001"]
+
            }
+
        ]
+
 
     }
 
     }
 +
  ]
 +
}
 
</nowiki>
 
</nowiki>
  
 +
=== Failure while trying to make an unauthorized request ===
 +
'''Request'''
 +
<nowiki>
 +
GET /images/detail
 +
Authorization: Basic {invalid authorization}
 +
</nowiki>
  
'''Failure while trying to make an unauthorized request'''
+
'''Response'''
:'''GET''' <nowiki>http://{api_server}/images/detail</nowiki>
+
<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 13:56, 24 May 2013

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

This operation will list all images including their details.

Contents

Request

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

URI 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":[
    {
      "status":"{status}",
      "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}"]
    },
    {
      "status":"{status}",
      "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_1}", "{zone_id_2}"]
    }
  ]
}

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
Zones where the image is available.

Examples

Successfully list image details

Request

GET /images/detail
Authorization: Basic {Base64-encoded username:password string}
 

Response

200 OK

{
  "images": [
    {
      "status": "ACTIVE", 
      "updated": null, 
      "name": "test_public_image", 
      "links": [
        {"href": "https://api.hostway.com/images/123/", "rel": "self"},
        {"href": "https://api.hostway.com/images/123/", "rel": "bookmark"}
      ],
      "created": "2011-11-09T03:19:48", 
      "id": "123",
      "zones": ["AUS001"]
    },
    {
      "status": "SAVING", 
      "updated": null, 
      "name": "test_debian_image", 
      "links": [
        {"href": "https://api.hostway.com/images/233/", "rel": "self"},
        {"href": "https://api.hostway.com/images/233/", "rel": "bookmark"}
      ],
      "created": "2011-09-30T02:38:57", 
      "id": "233",
      "zones": ["AUS001"]
    }, 
    {
      "status": "ACTIVE", 
      "updated": null, 
      "name": "test_private_image", 
      "links": [
        {"href": "https://api.hostway.com/images/145/", "rel": "self"},
        {"href": "https://api.hostway.com/images/145/", "rel": "bookmark"}
      ],
      "created": "2011-11-09T03:19:01", 
      "id": "145",
      "zones": ["AUS001"]
    }
  ]
}

Failure while trying to make an unauthorized request

Request

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

Response

401 Unauthorized
 

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox