Change Request

Introduction

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

Remember, a change request is created for every PUT request to a given Virtual Machine sub-resource.

ResourceURIDescriptionGETPOSTPUTDELETEPATCH
Change Request/request/changeChange Request Management resource. (tick)



Change Request/request/change/<rquest_id>Specific Change Request management resource(tick)
(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 change requests, do a GET request to /request resource as follows:

http GET https://vss-api.eis.utoronto.ca/v2/request/change "Authorization: Bearer $TK"
Response Body
{
    "data": [
        "https://vss-api.eis.utoronto.ca/v2/request/change/17",
        "https://vss-api.eis.utoronto.ca/v2/request/change/22",
        "https://vss-api.eis.utoronto.ca/v2/request/change/20",
        "https://vss-api.eis.utoronto.ca/v2/request/change/21",
        "https://vss-api.eis.utoronto.ca/v2/request/change/23",
        "https://vss-api.eis.utoronto.ca/v2/request/change/221",
        "https://vss-api.eis.utoronto.ca/v2/request/change/222",
        "https://vss-api.eis.utoronto.ca/v2/request/change/31",
        "https://vss-api.eis.utoronto.ca/v2/request/change/32",
        "https://vss-api.eis.utoronto.ca/v2/request/change/33"
    ],
    "meta": {
        "_link": {
            "self": "https://vss-api.eis.utoronto.ca/v2/request/change"
        },
        "count": 10,
        "pages": {
            "first_url": "https://vss-api.eis.utoronto.ca/v2/request/change?per_page=10&page=1",
            "last_url": "https://vss-api.eis.utoronto.ca/v2/request/change?per_page=10&page=11",
            "next_url": "https://vss-api.eis.utoronto.ca/v2/request/change?per_page=10&page=2",
            "page": 1,
            "pages": 11,
            "per_page": 10,
            "prev_url": null,
            "total": 109
        },
        "time": "0.02024s",
        "user": "josem"
    }
}

Update

Currently, only two attributes can be updated of a given change request: scheduled and scheduled_datetime. Both attributes allow you to schedule a change on a given date and time (How to schedule VM changes) and updating listed attributes allow you to either cancel or re-schedule a given change without deleting it or resubmitting your request.

To CANCEL an already SCHEDULED change:

http PUT https://vss-api.eis.utoronto.ca/v2/request/change/<change_id> "Authorization: Bearer $TK" scheduled:=false 

curl -H "Content-Type: application/json" -H "Authorization: Bearer $TK" -X PUT https://vss-api.eis.utoronto.ca/v2/request/change/<change_id> -d '{"scheduled": false}'

To reschedule a scheduled change:

http PUT https://vss-api.eis.utoronto.ca/v2/request/change/<change_id> "Authorization: Bearer $TK" schaeduled_datetime="2016-10-20 21:50" scheduled:=true

curl -H "Content-Type: application/json" -H "Authorization: Bearer $TK" -X PUT https://vss-api.eis.utoronto.ca/v2/request/change/<change_id> -d '{"scheduled_datetime": "2016-10-20 21:50", "scheduled": true}'

Both requests 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

Executed a failed request

To re-execute a request with status ERROR, use the PATCH method:

http PATCH https://vss-api.eis.utoronto.ca/v2/request/change/<change_id> "Authorization: Bearer $TK"

curl -H "Content-Type: application/json" -H "Authorization: Bearer $TK" -X PATCH https://vss-api.eis.utoronto.ca/v2/request/change/<change_id>

Previous request, will result in a response with the new task_id:

{
    "data": {
        "_links": {
            "request": "https://vss-api.eis.utoronto.ca/v2/request/change/3", 
            "task": "https://vss-api.eis.utoronto.ca/v2/request/task/0f39fa9f-4f35-426a-8ebb-8f1b34588fef"
        }, 
        "message": "VM Change Request has been accepted for processing", 
        "name": "Accepted", 
        "state": "Submitted", 
        "status": 202
    }, 
    "meta": {
        "time": "0.03691s", 
        "user": "jm"
    }
}