ScriptController Resource

This controller is responsible for handling user scripts. These user can be used by the provisoner to run on the created VMs.

POST /user/v1.0/script

Security Roles Allowed
ADMIN, USER
Request Body
media type data type
application/json Script (JSON)
application/xml script (XML)
Response Body
media type data type
application/json string (JSON)
application/xml string (XML)

Example

Request
POST /user/v1.0/script
Content-Type: application/json
Accept: application/json

                
{
  "id" : "...",
  "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" : "..."
}
                
              
Response
HTTP/1.1 201 Looks Good
Content-Type: application/json

                
...
                
              

DELETE /user/v1.0/script/all

Security Roles Allowed
ADMIN
Response Body
media type data type
application/json string (JSON)
application/xml string (XML)

Example

Request
DELETE /user/v1.0/script/all
Accept: application/json

              
Response
HTTP/1.1 204 Looks Good
Content-Type: application/json

                
...
                
              

GET /user/v1.0/script/ids

Gets the IDs of all the stored scripts

Response Body
media type data type description
application/json array of string (JSON) a list of all the IDs
application/xml list of string (XML)

Example

Request
GET /user/v1.0/script/ids
Accept: application/json

              
Response
HTTP/1.1 200 Looks Good
Content-Type: application/json

                
...
                
              

GET /user/v1.0/script/sample

Security Roles Allowed
ADMIN, USER
Response Body
media type data type
application/json Script (JSON)
application/xml script (XML)

Example

Request
GET /user/v1.0/script/sample
Accept: application/json

              
Response
HTTP/1.1 200 Looks Good
Content-Type: application/json

                
{
  "id" : "...",
  "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" : "..."
}
                
              

POST /user/v1.0/script/upload

Uploads a script

Security Roles Allowed
ADMIN, USER
Request Parameters
name type description
file query  
Response Body
media type data type description
application/json string (JSON) the ID of the stopred script
application/xml string (XML)

Example

Request
POST /user/v1.0/script/upload
Accept: application/json

              
Response
HTTP/1.1 201 Looks Good
Content-Type: application/json

                
...
                
              

DELETE /user/v1.0/script/{id}

Security Roles Allowed
ADMIN, USER
Request Parameters
name type description
id path  
Response Body
media type data type
application/json string (JSON)
application/xml string (XML)

Example

Request
DELETE /user/v1.0/script/{id}
Accept: application/json

              
Response
HTTP/1.1 204 Looks Good
Content-Type: application/json

                
...
                
              

GET /user/v1.0/script/{id}

Gets a script

Security Roles Allowed
ADMIN, USER
Request Parameters
name type description
id path  
Response Body
media type data type description
application/json Script (JSON) the script
application/xml script (XML)

Example

Request
GET /user/v1.0/script/{id}
Accept: application/json

              
Response
HTTP/1.1 200 Looks Good
Content-Type: application/json

                
{
  "id" : "...",
  "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" : "..."
}