ServerSnapshotList
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
Latest revision as of 11:00, 11 October 2013
This operation returns a list of all server snapshots.
Contents |
GET /accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/{snapshot_id}/
Parameters
- accountId - string
- The selected account Id.
- server_id
- The unique identifier of the server.
- snapshot_id
- The unique identifier of the server snapshot
Result
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.
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.
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" } }
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}