ServerSnapshotCreate
(→Response Codes) |
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
Latest revision as of 11:00, 11 October 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