ServerSnapshotList

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 86)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This operation will return a list of all [[ServerSnapshot|server snapshots]].
+
This operation returns a list of all [[ServerSnapshot|server snapshots]].
  
='''GET''' /servers/'''server_id'''/snapshots/'''snapshot_id'''/=
+
='''GET''' /accounts/''{accountId}''/flexcloud/servers/''{server_id}''/snapshots/''{snapshot_id}''/=
  
 
== Parameters ==
 
== Parameters ==
 +
; accountId - ''string''
 +
: The selected account Id.
 +
 
; server_id
 
; server_id
 
: The unique identifier of the server.
 
: The unique identifier of the server.
Line 24: Line 27:
 
                     "status": '{status}',
 
                     "status": '{status}',
 
                     "create_time": "{create_time}",
 
                     "create_time": "{create_time}",
                     "links": [{'href': 'http://{api_server}/servers/{server_id}/', 'rel': 'self'}],
+
                     "links": [{'href': 'http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/', 'rel': 'self'}],
 
                 },
 
                 },
 
                 {
 
                 {
Line 35: Line 38:
 
                     "status": '{status}',
 
                     "status": '{status}',
 
                     "create_time": "{create_time}",
 
                     "create_time": "{create_time}",
                     "links": [{'href': 'http://{api_server}/servers/{server_id}/', 'rel': 'self'}],
+
                     "links": [{'href': 'http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/', 'rel': 'self'}],
 
                 }
 
                 }
 
             ]
 
             ]
Line 74: Line 77:
 
; Failure:
 
; 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.
 
:''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.
 +
:''HTTP/1.1 404 Not Found'' - The resource does not exist.
  
 
== Examples ==
 
== Examples ==
 
'''Successfully list server snapshots'''
 
'''Successfully list server snapshots'''
:'''GET''' http(s)://{api_server}/servers/{server_id}/snapshots/
+
:'''GET''' http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/
  
  
Line 103: Line 107:
 
             "links": [
 
             "links": [
 
                 {
 
                 {
                     "href": "http://{api_server}/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul18_Fkmm7a2ZM/",  
+
                     "href": "http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul18_Fkmm7a2ZM/",  
 
                     "rel": "self"
 
                     "rel": "self"
 
                 }]  
 
                 }]  
Line 118: Line 122:
 
             "links": [
 
             "links": [
 
                 {
 
                 {
                     "href": "http://10.10.150.59:6543/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_Hzxp5LHGz/",  
+
                     "href": "http://10.10.150.59:6543/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_Hzxp5LHGz/",  
 
                     "rel": "self"
 
                     "rel": "self"
 
                 }],  
 
                 }],  
Line 133: Line 137:
 
             "links": [
 
             "links": [
 
                 {
 
                 {
                     "href":  "http://10.10.150.59:6543/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/",  
+
                     "href":  "http://10.10.150.59:6543/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/",  
 
                     "rel": "self"
 
                     "rel": "self"
 
                 }],  
 
                 }],  
Line 141: Line 145:
  
 
'''Failure while trying to make unauthorized access'''
 
'''Failure while trying to make unauthorized access'''
:'''GET''' <nowiki>http(s)://{api_server}/servers/{server_id}/snapshots/</nowiki>
+
:'''GET''' <nowiki>http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/</nowiki>
  
 
''Request Headers:''
 
''Request Headers:''
Line 158: Line 162:
 
     does not understand how to supply the credentials required.
 
     does not understand how to supply the credentials required.
  
 +
'''Failure while trying to pass invalid account number'''
 +
:'''GET''' <nowiki>http(s)://{api_server}/accounts/fake/flexcloud/servers/{server_id}/snapshots/</nowiki>
 +
 +
''Response Code:''
 +
<pre>HTTP/1.1 404 Not Found</pre>
 +
 +
''Response Body:''
 +
<nowiki>
 +
{
 +
    "itemNotFound" : {
 +
      "message": "Resource not found",
 +
      "code": 404,
 +
      "details": "",
 +
      "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
 +
    }
 +
}</nowiki>
  
<!--  THIS CODE ENABLES DISQUS COMMENTS ON THE PAGE - DELETE TO DISABLE COMMENTING-->
+
== Alternative URI /servers/{server_id}/snapshots/{snapshot_id} ==
 +
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]].
  
{{#widget:DISQUS
+
<code>GET /servers/{server_id}/snapshots/{snapshot_id}</code>
|id=hostway
+
|uniqid={{PAGENAME}}
+
|url={{fullurl:{{PAGENAME}}}}
+
}}
+
  
<!--  ########################################################################### -->
+
[[Category:Hostway API]]
 +
[[Category:FlexCloud Server API]]

Latest revision as of 12:00, 11 October 2013

This operation returns a list of all server snapshots.

Contents

[edit] GET /accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/{snapshot_id}/

[edit] Parameters

accountId - string
The selected account Id.
server_id
The unique identifier of the server.
snapshot_id
The unique identifier of the server snapshot

[edit] Result

[edit] JSON

{
            'snapshots': [
                {
                    "id": "{snapshot_id}",
                    "name": "{display_name}",
                    "description": "{description}",
                    "guid": "{guid}",
                    "parent_guid": "{parent_guid}",
                    "relation_guid": "{releation_guid}",
                    "status": '{status}',
                    "create_time": "{create_time}",
                    "links": [{'href': 'http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/', 'rel': 'self'}],
                },
                {
                    "id": "{snapshot_id}",
                    "name": "{display_name}",
                    "description": "{description}",
                    "guid": "{guid}",
                    "parent_guid": "{parent_guid}",
                    "relation_guid": "{releation_guid}",
                    "status": '{status}',
                    "create_time": "{create_time}",
                    "links": [{'href': 'http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/', 'rel': 'self'}],
                }
            ]
        }
}
id - string
Unique identifier for this server snapshot.
name - string
Display name of this server snapshot.
description - string
Description of this server snapshot.
guid - string
GUID of this server snapshot.
parent_guid - string
Parent GUID of this server snapshot.
relation_guid - string
Relation GUID of this server snapshot.
status - string
Status of this server snapshot; one out of 'ACTIVE', 'BUILD', 'DELETED'
create_time - string
Created time of this server snapshot
links - array
Hypermedia for this resource.

[edit] Response Codes

Success
HTTP/1.1 202 ACCEPTED
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.
HTTP/1.1 404 Not Found - The resource does not exist.

[edit] Examples

Successfully list server snapshots

GET http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/


Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Response Code:

HTTP/1.1 200 OK

Response Body:

{
    'snapshots': [
        { 
            "id": "snapshot_jello614636-USOTE-0214_2012Jul18_Fkmm7a2ZM", 
            "name": "fitnesse snapshot
            "description": "fitnesse test snapshot", 
            "status": "ACTIVE", 
            "guid": "5c51c729-2cbe-4eb8-a116-6fef5a5f5c12", 
            "parent_guid": "e039d899-4207-4984-a408-7400a3eaf27b", 
            "relation_guid": "491aee4b-34bc-45e5-ac47-7ef9fb96c4c4", 
            "create_time": "2012-07-18 15:48:12", 
            "links": [
                {
                    "href": "http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul18_Fkmm7a2ZM/", 
                    "rel": "self"
                }] 
        },
        {
            "id": "snapshot_jello614636-USOTE-0214_2012Jul19_Hzxp5LHGz", 
            "name": "fitnesse snapshot"
            "description": "fitnesse test snapshot", 
            "status": "DELETED", 
            "guid": "cdc39fc9-cda9-4eae-aeb9-274e5f8d1642", 
            "parent_guid": "491aee4b-34bc-45e5-ac47-7ef9fb96c4c4", 
            "relation_guid": "b4833231-b685-415b-9977-42d7424d6646", 
            "create_time": "2012-07-19 12:36:55", 
            "links": [
                {
                    "href": "http://10.10.150.59:6543/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_Hzxp5LHGz/", 
                    "rel": "self"
                }], 
        },
        { 
            "id": "snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a",  
            "name": "fitnesse snapshot"
            "description": "fitnesse test snapshot", 
            "status": "ACTIVE", 
            "guid": "a4e76fdf-8696-4848-ba81-cfe090e1401d", 
            "parent_guid": "491aee4b-34bc-45e5-ac47-7ef9fb96c4c4", 
            "relation_guid": "42130087-f34c-4823-885d-8a908017ed8d", 
            "create_time": "2012-07-19 16:28:09", 
            "links": [
                {
                    "href":  "http://10.10.150.59:6543/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/", 
                    "rel": "self"
                }], 
        }
   ]
}

Failure while trying to make unauthorized access

GET http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/

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.

Failure while trying to pass invalid account number

GET http(s)://{api_server}/accounts/fake/flexcloud/servers/{server_id}/snapshots/

Response Code:

HTTP/1.1 404 Not Found

Response Body:

 {
    "itemNotFound" : {
       "message": "Resource not found", 
       "code": 404, 
       "details": "",
       "errorid": "59e0b3dd-2173-432a-8ff5-60efe16e83bf"
    }
 }

[edit] Alternative URI /servers/{server_id}/snapshots/{snapshot_id}

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 /servers/{server_id}/snapshots/{snapshot_id}

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox