ServerSnapshotCreate

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(Response Codes)
Line 1: Line 1:
 
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.
 
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.
  
='''POST''' /servers/'''server_id'''/snapshots=
+
='''POST''' /accounts/''{accountId}''/flexcloud/servers/''{server_id}''/snapshots=
 +
This operation will create a new server snapshot. 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.
  
 
== 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 35: Line 39:
 
         "relation_guid": "{relation_guid}",  
 
         "relation_guid": "{relation_guid}",  
 
         "create_time": "{create_time}",  
 
         "create_time": "{create_time}",  
         "links": [{"href": "http://{api_server}/servers/{server_id}/snapshots/{snapshot_id}/",  
+
         "links": [{"href": "http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/{snapshot_id}/",  
 
                   "rel": "self"}],  
 
                   "rel": "self"}],  
 
     }
 
     }
Line 76: Line 80:
 
:''HTTP/1.1 400 Bad Request''
 
:''HTTP/1.1 400 Bad Request''
 
::The snapshot cannot be created because the server contains extra volumes.
 
::The snapshot cannot be created because the server contains extra volumes.
 +
 +
:''HTTP/1.1 404 itemNotFound''
 +
::The resource does not exist
  
 
:''HTTP/1.1 409 Conflict''
 
:''HTTP/1.1 409 Conflict''
Line 81: Line 88:
  
 
:''HTTP/1.1 413 Request entity too large''
 
:''HTTP/1.1 413 Request entity too large''
::The snapshot can be created up to 3 in a server.  
+
::The snapshot can be created up to 3 in a server.
 
+
  
 
== Examples ==
 
== Examples ==
 
'''Successfully create a new server'''
 
'''Successfully create a new server'''
:'''POST''' <nowiki>http://{api_server}/servers/{server_id}/snapshots</nowiki>
+
:'''POST''' <nowiki>http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots</nowiki>
  
 
''Request Headers:''
 
''Request Headers:''
Line 118: Line 124:
 
         "create_time": "0000-00-00 00:00:00",  
 
         "create_time": "0000-00-00 00:00:00",  
 
         "links": [
 
         "links": [
             {"href": "http://{api_server}/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/",  
+
             {"href": "http://{api_server}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/",  
 
             "rel": "self"}],  
 
             "rel": "self"}],  
 
     }
 
     }
 
}</nowiki>
 
}</nowiki>
  
{{disqus}}
+
'''Failure while trying to update server with a wrong account number'''
 +
:'''POST''' <nowiki>http://{api_server}/accounts/fake/flexcloud/servers/{server_id}/snapshots</nowiki>
 +
 
 +
''Response Code:''
 +
<pre>HTTP/1.1 404 Not Found</pre>
 +
 
 +
== Alternative URI /servers/{server_id}/snapshots ==
 +
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>POST /servers/{server_id}/snapshots</code>
 +
 
 
[[Category:Hostway API]]
 
[[Category:Hostway API]]
 
[[Category:FlexCloud Server API]]
 
[[Category:FlexCloud Server API]]

Revision as of 07:03, 12 July 2013

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 /accounts/{accountId}/flexcloud/servers/{server_id}/snapshots

This operation will create a new server snapshot. 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.

Parameters

accountId - string
The selected account Id.
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}/accounts/{accountId}/flexcloud/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 404 itemNotFound
The resource does not exist
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}/accounts/{accountId}/flexcloud/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}/accounts/{accountId}/flexcloud/servers/{server_id}/snapshots/snapshot_jello614636-USOTE-0214_2012Jul19_m5yf9Bz8a/", 
             "rel": "self"}], 
    }
}

Failure while trying to update server with a wrong account number

POST http://{api_server}/accounts/fake/flexcloud/servers/{server_id}/snapshots

Response Code:

HTTP/1.1 404 Not Found

Alternative URI /servers/{server_id}/snapshots

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.

POST /servers/{server_id}/snapshots

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox