ImageListDetails

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 86)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= GET /images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}'' =
+
= 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__
 
__TOC__
 
== Request ==
 
== Request ==
<code>GET /images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}''</code>
+
<code>GET /accounts/''{accountId}''/flexcloud/images/detail?name=''{imageName}''&status=''{imageStatus}''&type=''{imageType}''&zone=''{zoneId}''</code>
  
 
=== URI Parameters ===
 
=== URI Parameters ===
 +
; accountId - ''string''
 +
: The ID of the selected account.
 +
 
; name - ''string''
 
; name - ''string''
 
: ''Optional'' image name to search for.
 
: ''Optional'' image name to search for.
Line 26: Line 29:
 
; 401 Unauthorized
 
; 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.
 
: 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 ===
 
=== Response Body ===
Line 36: Line 42:
 
       "name":"{display_image_name}",
 
       "name":"{display_image_name}",
 
       "links":[
 
       "links":[
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"self"},
+
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"},
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"bookmark"}
+
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"bookmark"}
 
       ],
 
       ],
 
       "created":"yyyy-mm-ddThh:mm:ss",
 
       "created":"yyyy-mm-ddThh:mm:ss",
Line 48: Line 54:
 
       "name":"{display_image_name}",
 
       "name":"{display_image_name}",
 
       "links":[
 
       "links":[
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"self"},
+
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"self"},
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/images/{image_id}/", "rel":"bookmark"}
+
         {"href":"</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/{image_id}/", "rel":"bookmark"}
 
       ],
 
       ],
 
       "created":"yyyy-mm-ddThh:mm:ss",
 
       "created":"yyyy-mm-ddThh:mm:ss",
Line 56: Line 62:
 
     }
 
     }
 
   ]
 
   ]
}
+
}</nowiki>
</nowiki>
+
  
 
==== Parameters ====
 
==== Parameters ====
Line 89: Line 94:
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
GET /images/detail
+
GET /accounts/{accountId}/flexcloud/images/detail
Authorization: Basic {Base64-encoded username:password string}
+
Authorization: Basic {Base64-encoded username:password string} </nowiki>
</nowiki>
+
  
 
'''Response'''
 
'''Response'''
Line 104: Line 108:
 
       "name": "test_public_image",  
 
       "name": "test_public_image",  
 
       "links": [
 
       "links": [
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/123/", "rel": "self"},
+
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/123/", "rel": "self"},
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/123/", "rel": "bookmark"}
+
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/123/", "rel": "bookmark"}
 
       ],
 
       ],
 
       "created": "2011-11-09T03:19:48",  
 
       "created": "2011-11-09T03:19:48",  
Line 116: Line 120:
 
       "name": "test_debian_image",  
 
       "name": "test_debian_image",  
 
       "links": [
 
       "links": [
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/233/", "rel": "self"},
+
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/233/", "rel": "self"},
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/233/", "rel": "bookmark"}
+
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/233/", "rel": "bookmark"}
 
       ],
 
       ],
 
       "created": "2011-09-30T02:38:57",  
 
       "created": "2011-09-30T02:38:57",  
Line 128: Line 132:
 
       "name": "test_private_image",  
 
       "name": "test_private_image",  
 
       "links": [
 
       "links": [
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/145/", "rel": "self"},
+
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/145/", "rel": "self"},
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/images/145/", "rel": "bookmark"}
+
         {"href": "</nowiki>{{APIBaseURL}}<nowiki>/accounts/{accountId}/flexcloud/images/145/", "rel": "bookmark"}
 
       ],
 
       ],
 
       "created": "2011-11-09T03:19:01",  
 
       "created": "2011-11-09T03:19:01",  
Line 136: Line 140:
 
     }
 
     }
 
   ]
 
   ]
}
+
}</nowiki>
</nowiki>
+
  
 
=== Failure while trying to make an unauthorized request ===
 
=== Failure while trying to make an unauthorized request ===
 
'''Request'''
 
'''Request'''
 
  <nowiki>
 
  <nowiki>
GET /images/detail
+
GET /accounts/{accountId}/flexcloud/images/detail
Authorization: Basic {invalid authorization}
+
Authorization: Basic {invalid authorization} </nowiki>
</nowiki>
+
  
 
'''Response'''
 
'''Response'''
 
  <nowiki>
 
  <nowiki>
401 Unauthorized
+
401 Unauthorized </nowiki>
  </nowiki>
+
 
 +
=== Account Number not found ===
 +
'''Request'''
 +
  <nowiki>
 +
GET /accounts/fake/flexcloud/images
 +
Authorization: Basic {Base64-encoded username:password string}</nowiki>
 +
 
 +
'''Response'''
 +
<nowiki>
 +
{
 +
    "itemNotFound": {
 +
        "guid": "23684df5-0532-4794-802d-fdc82e4e7e7c",
 +
        "message": "Resource not found",
 +
        "code": 404,
 +
        "details": ""
 +
    }
 +
}</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]].
 +
 
 +
<code>GET /images/detail</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 11:00, 11 October 2013

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

This operation will list all images including their details.

Contents

[edit] Request

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

[edit] 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.

[edit] Response

[edit] 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

[edit] 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}"]
    }
  ]
}

[edit] 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.

[edit] Examples

[edit] 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"]
    }
  ]
}

[edit] Failure while trying to make an unauthorized request

Request

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

Response

401 Unauthorized 

[edit] 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": ""
    }
}

[edit] 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

[edit] See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox