ImageListDetails

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 86)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
= GET /accounts/''{accountId}''/flexcloud/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 /accounts/''{accountId}''/flexcloud/images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}''</code>
  
'''GET''' /images/detail
+
=== URI Parameters ===
 +
; accountId - ''string''
 +
: The ID of the selected account.
  
== Parameters ==
+
; name - ''string''
No parameters
+
: ''Optional'' image name to search for.
  
== Result ==
+
; status - ''string''
=== JSON ===
+
: ''Optional'' Image status to search for. Values: '''ACTIVE''', '''SAVING''', '''DELETED'''.
<big><source lang="javascript">
+
{
+
  "images":[
+
      {
+
        "status":"{status}",
+
        "updated":null,
+
        "name":"{display_image_name}",
+
        "links":[
+
            {
+
              "href":"http://{server_name}/images/{image_id}/",
+
              "rel":"self"
+
            },
+
            {
+
              "href":"http://{server_name}/images/{image_id}/",
+
              "rel":"bookmark"
+
            }
+
        ],
+
        "created":"2011-09-30T02:38:57",
+
        "id":"{image_id}"
+
      },
+
      {
+
        "status":"{status}",
+
        "updated":null,
+
        "name":"{display_image_name}",
+
        "links":[
+
            {
+
              "href":"http://{server_name}/images/{image_id}/",
+
              "rel":"self"
+
            },
+
            {
+
              "href":"http://{server_name}/images/{image_id}/",
+
              "rel":"bookmark"
+
            }
+
        ],
+
        "created":"2011-12-27T02:59:27",
+
        "id":"{image_id}"
+
      }
+
  ]
+
}
+
</source></big>
+
  
 +
; 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.
 +
 +
; 404 Not Found
 +
: Failure - The Resource was not found
 +
 +
=== Response Body ===
 +
<nowiki>
 +
{
 +
  "images":[
 +
    {
 +
      "status":"{status}",
 +
      "updated":null,
 +
      "name":"{display_image_name}",
 +
      "links":[
 +
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"},
 +
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/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":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"},
 +
        {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"bookmark"}
 +
      ],
 +
      "created":"yyyy-mm-ddThh:mm:ss",
 +
      "id":"{image_id}",
 +
      "zones": ["{zone_id_1}", "{zone_id_2}"]
 +
    }
 +
  ]
 +
}</nowiki>
  
 +
==== Parameters ====
 
; id - ''string''
 
; id - ''string''
 
: Unique identifier for this image.
 
: Unique identifier for this image.
Line 61: Line 76:
 
; 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 71: Line 86:
 
: Unused always null.
 
: Unused always null.
  
== Response Codes ==
+
; zones
; Success: HTTP/1.1 200 OK
+
: Zones where the image is available.
 
+
; 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 ==
'''List image including details'''
 
:'''GET''' <nowiki>http://{api_url}/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 /accounts/{accountId}/flexcloud/images/detail
 +
Authorization: Basic {Base64-encoded username:password string} </nowiki>
  
''Response Code:''
+
'''Response'''
<pre>HTTP/1.1 200 OK</pre>
+
<nowiki>
 +
200 OK
  
''Response Body:''
+
{
<big><source lang="javascript">
+
  "images": [
 +
    {
 +
      "status": "ACTIVE",
 +
      "updated": null,
 +
      "name": "test_public_image",
 +
      "links": [
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/123/", "rel": "self"},
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/123/", "rel": "bookmark"}
 +
      ],
 +
      "created": "2011-11-09T03:19:48",
 +
      "id": "123",
 +
      "zones": ["AUS001"]
 +
    },
 +
    {
 +
      "status": "SAVING",
 +
      "updated": null,
 +
      "name": "test_debian_image",
 +
      "links": [
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/233/", "rel": "self"},
 +
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/233/", "rel": "bookmark"}
 +
      ],
 +
      "created": "2011-09-30T02:38:57",
 +
      "id": "233",
 +
      "zones": ["AUS001"]
 +
    },
 
     {
 
     {
      "images": [
+
      "status": "ACTIVE",  
          {
+
      "updated": null,  
            "status": "ACTIVE",  
+
      "name": "test_private_image",  
            "updated": null,  
+
      "links": [
            "name": "dimitrov_public_image",  
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/145/", "rel": "self"},
            "links": [
+
        {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/145/", "rel": "bookmark"}
                {
+
      ],
                  "href": "http://{api_server}/images/vmi2011Nov08_2D2fLloqt/",
+
      "created": "2011-11-09T03:19:01",  
                  "rel": "self"
+
      "id": "145",
                },
+
      "zones": ["AUS001"]
                {
+
                  "href": "http://{api_server}/images/vmi2011Nov08_2D2fLloqt/",
+
                  "rel": "bookmark"
+
                }
+
              ],
+
              "created": "2011-11-09T03:19:48",
+
              "id": "vmi2011Nov08_2D2fLloqt"
+
          },
+
          {
+
              "status": "SAVING",
+
              "updated": null,
+
              "name": "debian",
+
              "links": [
+
                {
+
                    "href": "http://{api_server}/images/debian_lenny_template/",  
+
                    "rel": "self"
+
                },  
+
                {
+
                    "href": "http://{api_server}/images/debian_lenny_template/",
+
                    "rel": "bookmark"
+
                }
+
              ],
+
              "created": "2011-09-30T02:38:57",
+
              "id": "debian_lenny_template"
+
          },
+
          {
+
              "status": "SAVING",
+
              "updated": null,
+
              "name": "test by shimde",
+
              "links": [
+
                {
+
                    "href": "http://{api_server}/images/vmi2011Dec26_2C7D8Dbur/",
+
                    "rel": "self"
+
                },
+
                {
+
                    "href": "http://{api_server}/images/vmi2011Dec26_2C7D8Dbur/",  
+
                    "rel": "bookmark"
+
                }
+
              ],  
+
              "created": "2011-12-27T02:59:27",  
+
              "id": "vmi2011Dec26_2C7D8Dbur"
+
          },  
+
          {
+
              "status": "ACTIVE",
+
              "updated": null,
+
              "name": "jello_private_image",
+
              "links": [
+
                {
+
                    "href": "http://{api_server}/images/vmi2011Nov08_xBHzvNEy8/",
+
                    "rel": "self"
+
                },
+
                {
+
                    "href": "http://{api_server}/images/vmi2011Nov08_xBHzvNEy8/",
+
                    "rel": "bookmark"
+
                }
+
              ],
+
              "created": "2011-11-09T03:19:01",
+
              "id": "vmi2011Nov08_xBHzvNEy8"
+
            }
+
        ]
+
 
     }
 
     }
</source></big>
+
  ]
 +
}</nowiki>
  
 +
=== Failure while trying to make an unauthorized request ===
 +
'''Request'''
 +
<nowiki>
 +
GET /accounts/{accountId}/flexcloud/images/detail
 +
Authorization: Basic {invalid authorization} </nowiki>
  
'''Unauthorized request'''
+
'''Response'''
:'''GET''' <nowiki>http://{api_url}/images/detail</nowiki>
+
<nowiki>
 +
401 Unauthorized </nowiki>
  
''Request Headers:''
+
=== Account Number not found ===
    Content-Type:application/json
+
'''Request'''
 +
<nowiki>
 +
GET /accounts/fake/flexcloud/images
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
  
''Response Code:''
+
'''Response'''
<pre>HTTP/1.1 401 Unauthorized</pre>
+
<nowiki>
 
+
{
''Response Body:''
+
    "itemNotFound": {
    401 Unauthorized
+
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
    This server could not verify that you are authorized to
+
        "message": "Resource not found",
    access the document you requested.  Either you supplied the
+
        "code": 404,
    wrong credentials (e.g., bad password), or your browser
+
        "details": ""
    does not understand how to supply the credentials required.
+
    }
 +
}</nowiki>
  
 +
== Alternative URI /images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}'' ==
 +
An alternative way to execute this call is to omit the ''accountId'' portion of the URI. In this case the system assumes the request is executed for the account identified in the [[Authentication|authorization header]].
  
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
+
<code>GET /images/detail</code>
  
{{#widget:DISQUS
+
== See also ==
|id=hostway
+
* [[FlexCloud Server|FlexCloud Server API]]
|uniqid={{PAGENAME}}
+
* [[Common Features]]
|url={{fullurl:{{PAGENAME}}}}
+
}}
+
  
<!--  ########################################################################### -->
+
{{disqus}}
 +
[[Category:Hostway API]]
 +
[[Category:FlexCloud Server API]]

Latest revision as of 11:00, 11 October 2013

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

This operation will list all images including their details.

Contents

Request

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

URI Parameters

accountId - string
The ID of the selected account.
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.
404 Not Found
Failure - The Resource was not found

Response Body

{
  "images":[
    {
      "status":"{status}",
      "updated":null,
      "name":"{display_image_name}",
      "links":[
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"},
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/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/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"},
        {"href":"https://api.hostway.com/accounts/{accountId}/flexcloud/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 /accounts/{accountId}/flexcloud/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/accounts/{accountId}/flexcloud/images/123/", "rel": "self"},
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/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/accounts/{accountId}/flexcloud/images/233/", "rel": "self"},
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/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/accounts/{accountId}/flexcloud/images/145/", "rel": "self"},
        {"href": "https://api.hostway.com/accounts/{accountId}/flexcloud/images/145/", "rel": "bookmark"}
      ],
      "created": "2011-11-09T03:19:01", 
      "id": "145",
      "zones": ["AUS001"]
    }
  ]
}

Failure while trying to make an unauthorized request

Request

GET /accounts/{accountId}/flexcloud/images/detail
Authorization: Basic {invalid authorization} 

Response

401 Unauthorized 

Account Number not found

Request

GET /accounts/fake/flexcloud/images
Authorization: Basic {Base64-encoded username:password string}

Response

{
    "itemNotFound": {
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
        "message": "Resource not found",
        "code": 404,
        "details": ""
    }
}

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

An alternative way to execute this call is to omit the accountId portion of the URI. In this case the system assumes the request is executed for the account identified in the authorization header.

GET /images/detail

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox