ServerSnapshotCreate

From Hostway API Documentation
Revision as of 08:54, 20 May 2013 by Mike.robski (Talk | contribs)
Jump to: navigation, search

This operation will create a new server snapshot of a server. Server snapshot creation is asynchronous, the progress can be checked with the URL in the response Location header or the self link in the body.

Contents

POST /servers/server_id/snapshots

Parameters

server_id
The unique identifier of the server.

JSON

{
    "snapshot": {
        "name": "{name}", 
        "description": "{description}"
    }
}
name - string
Display name for this server snapshot
description - string
Description for this server snapshot

Result

JSON

{
    "snapshot": {
        "id": "{snapshot_id}", 
        "name": "{snapshot_name}"
        "description": "{description}", 
        "status": "{status}", 
        "guid": "{guid}", 
        "parent_guid": "{parent_guid}", 
        "relation_guid": "{relation_guid}", 
        "create_time": "{create_time}", 
        "links": [{"href": "http://{api_server}/servers/{server_id}/snapshots/{snapshot_id}/", 
                   "rel": "self"}], 
    }
}

  • When a server snapshot is in pending status (has not completed the provisioning process), the create_time, guid, parent_guid, and relation_guid will be empty strings.
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; Values: '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
Request is accepted.
Failure
HTTP/1.1 400 Bad Request
The snapshot cannot be created because the server contains extra volumes.
HTTP/1.1 409 Conflict
The snapshot name must be unique in a server.
HTTP/1.1 413 Request entity too large
The snapshot can be created up to 3 in a server.


Examples

Successfully create a new server

POST http://{api_server}/servers/{server_id}/snapshots

Request Headers:

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

Request Body:

{
    "snapshot": {
        "name": "fitnesse snapshot", 
        "description": "fitnesse test snapshot"
    }
}

Response Code:

HTTP/1.1 202 Accepted

Response Body:

{
    "snapshot": {
        "id": "snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a", 
        "name": "test snapshot"
        "description": "test snapshot description", 
        "status": "BUILD", 
        "guid": "", 
        "parent_guid": "", 
        "relation_guid": "", 
        "create_time": "0000-00-00 00:00:00", 
        "links": [
            {"href": "http://{api_server}/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/", 
             "rel": "self"}], 
    }
}


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox