Change Request
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"
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" } }