Scheduled jobs module

GET /scheduler/jobs/

Load scheduled jobs list

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
  "jobs": [
    {
      "name": "Job1",
      "script": {
        "path": "/Path/To/Script",
        "rev": "6",
        "name": "details"
      },
      "created_at": "2015-02-10 01:22:02",
      "enabled": true,
      "private": false,
      "params": {},
      "owner": "username",
      "exec_period": "5 * * * * "
    }
  ],
  "quota": {"allowed": 10}
}
Request Headers:
 
  • X-Cr-User – User name
  • X-Cr-Token – Auth token
Status Codes:
POST /scheduler/jobs/

Create new scheduled job

Form Parameters:
 
  • name – Job name
  • script – Path to script
  • period – Period to execute (Eg. 0 * * * * - execute on every hour)
  • version – (optional) Specific version of the script. Defaults to HEAD
  • private – (optional) Set the job as private - only visible to the owner. Defaults to 0(false)
  • enabled – (optional) Enable/disable the job. Defaults to 1(true)
Request Headers:
 
  • X-Cr-User – User name
  • X-Cr-Token – Auth token

Example request:

PUT /billing/account HTTP/1.1
Host: api.cloudrunner.io
Accept: application/json
Content-Type:application/x-www-form-urlencoded; charset=UTF-8

name=test&script=/Demo/details&private=false&enabled=true&period=5 * * * *

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
  "success": {
    "status": "ok"
  }
}
Status Codes:
DELETE /scheduler/jobs/(name)

Delete a scheduled job

Query Parameters:
 
  • name – The job name

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
  "success": {
    "status": "ok"
  }
}
Status Codes: