This controller is responsible for handling user scripts. These user can be used by the provisoner to run on the created VMs.
media type | data type |
---|---|
application/json | Script (JSON) |
application/xml | script (XML) |
code | condition |
---|---|
401 | Bad credentials |
media type | data type |
---|---|
application/json | string (JSON) |
application/xml | string (XML) |
POST /user/v1.0/script/
Content-Type: application/json
Accept: application/json
{
"name" : "config.sh",
"contents" : " #!/bin/bash\necho \"Reading system-wide config....\" >&2\\n. /etc/cool.cfg\nif [ -r ~/.coolrc ]; then\n echo \"Reading user config....\" >&2\\n . ~/.coolrc\\nfi",
"owner" : "user1",
"id" : "58e3946e0fb4f562d84ba1ad",
"timestamp" : 1499793079011
}
HTTP/1.1 201 Looks Good
Content-Type: application/json
...
code | condition |
---|---|
401 | Bad credentials |
media type | data type |
---|---|
application/json | string (JSON) |
application/xml | string (XML) |
DELETE /user/v1.0/script/all Accept: application/json
HTTP/1.1 204 Looks Good
Content-Type: application/json
...
Gets the IDs of all the stored scripts
code | condition |
---|---|
401 | Bad credentials |
media type | data type | description |
---|---|---|
application/json | array of string (JSON) | a list of all the IDs |
application/xml | list of string (XML) |
GET /user/v1.0/script/ids Accept: application/json
HTTP/1.1 200 Looks Good
Content-Type: application/json
...
code | condition |
---|---|
401 | Bad credentials |
media type | data type |
---|---|
application/json | Script (JSON) |
application/xml | script (XML) |
GET /user/v1.0/script/sample Accept: application/json
HTTP/1.1 200 Looks Good
Content-Type: application/json
{
"name" : "config.sh",
"contents" : " #!/bin/bash\necho \"Reading system-wide config....\" >&2\\n. /etc/cool.cfg\nif [ -r ~/.coolrc ]; then\n echo \"Reading user config....\" >&2\\n . ~/.coolrc\\nfi",
"owner" : "user1",
"id" : "58e3946e0fb4f562d84ba1ad",
"timestamp" : 1499793079011
}
Uploads a script
name | type | description | constraints |
---|---|---|---|
file | query | required |
code | condition |
---|---|
401 | Bad credentials |
media type | data type | description |
---|---|---|
application/json | string (JSON) | the ID of the stopred script |
application/xml | string (XML) |
POST /user/v1.0/script/upload Accept: application/json
HTTP/1.1 201 Looks Good
Content-Type: application/json
...
name | type | description | constraints |
---|---|---|---|
id | path | required |
code | condition |
---|---|
401 | Bad credentials |
media type | data type |
---|---|
application/json | string (JSON) |
application/xml | string (XML) |
DELETE /user/v1.0/script/{id} Accept: application/json
HTTP/1.1 204 Looks Good
Content-Type: application/json
...
Gets a script
name | type | description | constraints |
---|---|---|---|
id | path | required |
code | condition |
---|---|
401 | Bad credentials |
media type | data type | description |
---|---|---|
application/json | Script (JSON) | the script |
application/xml | script (XML) |
GET /user/v1.0/script/{id} Accept: application/json
HTTP/1.1 200 Looks Good
Content-Type: application/json
{
"name" : "config.sh",
"contents" : " #!/bin/bash\necho \"Reading system-wide config....\" >&2\\n. /etc/cool.cfg\nif [ -r ~/.coolrc ]; then\n echo \"Reading user config....\" >&2\\n . ~/.coolrc\\nfi",
"owner" : "user1",
"id" : "58e3946e0fb4f562d84ba1ad",
"timestamp" : 1499793079011
}