Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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)   (tick)


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



Panel

On this page:

Table of Contents
outlinetrue



http OPTIONS "

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

Note
titleOPTIONS HTTP method

Remember, you can get allowed methods, description, parameters, etc. by making a OPTIONS HTTP request to /v2/request/snapshot.

Code Block
languagebash
Code Block
curl -X POST https://vss-api.eis.utoronto.ca/v2auth/request/snapshot"
-token -u <username>

For example, extracting the token with the jq command:

Code Block
TK=$(curl -X OPTIONSPOST "https://vss-api.eis.utoronto.ca/v2/request/snapshot"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:

Code Block
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"


Code Block
languagepy
titleResponse Body
collapsetrue
{
    "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:

Code Block
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:

Code Block
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:

Code Block
languagepy
collapsetrue
{
    "_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"
    }
}


Note

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