Snapshot

Introduction

The /v2/request/snapshot resource provides the list of submitted snapshot requests. With this resource you can get further detail about all or any specific snapshot requested.

ResourceURIDescriptionGETPOSTPUTDELETE
Snapshot/request/snapshotSnapshot Request Management resource. (tick)


Snapshot id/request/snapshot/<request_id>Specific Snapshot Request management resource(tick)
(tick)

On this page:

TK stores the Cloud API Token generated as a result of the following POST request to the /auth/request-token resource:

curl -X POST https://vss-api.eis.utoronto.ca/auth/request-token -u <username>

For example, extracting the token with the jq command:

TK=$(curl -X POST https://vss-api.eis.utoronto.ca/auth/request-token -u <username> | jq '.token')

List

To list a summary of your snapshot requests, do a GET request to /request resource as follows:

http GET https://vss-api.eis.utoronto.ca/v2/request/snapshot "Authorization: Bearer $TK"
curl -X GET https://vss-api.eis.utoronto.ca/v2/request/snapshot "Authorization: Bearer $TK"
Response Body
{
    "data": [
        "https://vss-api.eis.utoronto.ca/v2/request/snapshot/16",
        "https://vss-api.eis.utoronto.ca/v2/request/snapshot/4",
        "https://vss-api.eis.utoronto.ca/v2/request/snapshot/3",
        "https://vss-api.eis.utoronto.ca/v2/request/snapshot/17"
    ],
    "meta": {
        "_link": {
            "self": "https://vss-api.eis.utoronto.ca/v2/request/snapshot"
        },
        "count": 4,
        "pages": {
            "first_url": "https://vss-api.eis.utoronto.ca/v2/request/snapshot?per_page=10&page=1",
            "last_url": "https://vss-api.eis.utoronto.ca/v2/request/snapshot?per_page=10&page=1",
            "next_url": null,
            "page": 1,
            "pages": 1,
            "per_page": 10,
            "prev_url": null,
            "total": 4
        },
        "time": "0.04322s",
        "user": "jm"
    }
}

Update

Currently, only one attribute can be updated of a given snapshot request: duration. The duration attribute allows you to extend the snapshot lifetime for a maximum of 72 hours for only 3 occasions.

To extend an already scheduled snapshot:

http PUT https://vss-api.eis.utoronto.ca/v2/request/snapshot/<req_id> "Authorization: Bearer $TK" attribute=duration value:=72

curl -H "Content-Type: application/json" -H "Authorization: Bearer $TK" -X PUT https://vss-api.eis.utoronto.ca/v2/request/snapshot/<req_id> -d '{"attribute": "duration", "value": 72}'

Request will result in an empty response body with a 204 status as follows:

HTTP/1.0 204 NO CONTENT
Allow: PUT, HEAD, OPTIONS, GET
Connection: keep-alive
Content-Length: 1097
Content-Type: application/json
Date: Thu, 20 Oct 2016 16:00:44 GMT
Server: nginx
Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4998
X-RateLimit-Reset: 1476982800

After successfully updating the request, you'll get something like:

{
    "_link": {
        "request": "https://vss-api.eis.utoronto.ca/v2/request/snapshot",
        "self": "https://vss-api.eis.utoronto.ca/v2/request/snapshot/16"
    },
    "data": {
        "_links": {
            "vm": "https://vss-api.eis.utoronto.ca/v2/vm/5012ae58-c1bf-b2ce-25be-f3f855fe279e"
        },
        "action": "Delete",
        "created_on": "2016-10-24 10:20:40 EDT",
        "extensions": 2,
        "id": 16,
        "message": {},
        "snapshot": {
            "description": "Testing snapshot extensions from 2016-10-24 10:20:00-04:00 valid for 2",
            "from_date": "2016-10-24 10:20:00 EDT",
            "name": "SR-1",
            "snap_id": 1,
            "to_date": "2016-11-11 10:20:00 EST",
            "valid_for": "2"
        },
        "status": "Submitted",
        "task_id": null,
        "updated_on": "2016-10-26 11:55:45 EDT",
        "user": {
            "id": 2,
            "username": "jm"
        },
        "vm_name": "1610T-naughty_galileo",
        "vm_uuid": "5012ae58-c1bf-b2ce-25be-f3f855fe279e"
    },
    "meta": {
        "count": 13,
        "time": "0.00730s",
        "user": "jm"
    }
}

Attribute extensions has increased and to_date is now extended to original + 6 days.