Cluster API Jobs

Cluster API documentation for the jobs

Jobs

GET /jobs

Get the list of jobs in the cluster

Request Headers:
 
  • waitIndex – The wait index is used to monitor the jobs with a long pull.
Response JSON Object:
 
  • [] (object) –
  • [].name (string) – The job name.
  • [].status (string) – The job status.
  • [].autostart (boolean) – If the job start when starting all jobs.
  • [].byCluster (boolean) – If the job must start for each cluster.
  • [].taskGroups[] (object) – An array of task group.
  • [].taskGroups[].name (string) – The task group name.
  • [].taskGroups[].count (integer) – The required number of task group to run.
  • [].taskGroups[].summary.queued (integer) –
  • [].taskGroups[].summary.complete (integer) –
  • [].taskGroups[].summary.failed (integer) –
  • [].taskGroups[].summary.running (integer) –
  • [].taskGroups[].summary.starting (integer) –
  • [].taskGroups[].summary.lost (integer) –
Response Headers:
 
  • waitIndex – undefined

Example response:

[
  {
    "name": "jobName",
    "status": "running",
    "autostart": true,
    "byCluster": true,
    "taskGroups": [
      {
        "name": "takGroupName",
        "count": 0,
        "summary": {
          "queued": 0,
          "complete": 0,
          "failed": 0,
          "running": 0,
          "starting": 0,
          "lost": 0
        }
      }
    ]
  }
]
GET /job/{jobName}/summary

Get the job summary

Parameters:
  • jobName – The job name
Response JSON Object:
 
  • name (string) – The job name.
  • status (string) – The job status.
  • autostart (boolean) – If the job start when starting all jobs.
  • byCluster (boolean) – If the job must start for each cluster.
  • taskGroups[] (object) – An array of task group.
  • taskGroups[].name (string) – The task group name.
  • taskGroups[].count (integer) – The required number of task group to run.
  • taskGroups[].summary.queued (integer) –
  • taskGroups[].summary.complete (integer) –
  • taskGroups[].summary.failed (integer) –
  • taskGroups[].summary.running (integer) –
  • taskGroups[].summary.starting (integer) –
  • taskGroups[].summary.lost (integer) –

Example response:

{
  "name": "jobName",
  "status": "running",
  "autostart": true,
  "byCluster": true,
  "taskGroups": [
    {
      "name": "takGroupName",
      "count": 0,
      "summary": {
        "queued": 0,
        "complete": 0,
        "failed": 0,
        "running": 0,
        "starting": 0,
        "lost": 0
      }
    }
  ]
}
POST /jobs/start/{jobName}

Schedule the job to start

Parameters:
  • jobName – The job name
POST /jobs/stop/{jobName}

Schedule the job to stop

Parameters:
  • jobName – The job name
POST /jobs/startall

Schedule all autostart jobs

POST /jobs/stopall

Schedule all jobs to stop

POST /jobs/updatecounts

Increment or decrement a task group count. If count is 0, set it to 0.

Request JSON Object:
 
  • jobID (string) – The name of the job.
  • taskGroup (string) – The task group.
  • count (integer) – The count delta. 0 will stop the job.

Example query:

{
  "jobID": "jobName",
  "taskGroup": "taskGrouName",
  "count": 0
}
POST /jobs/settaskgroupcount

Set a task group count.

New in version 1.23.0.

Request JSON Object:
 
  • jobID (string) – The name of the job.
  • taskGroup (string) – The task group.
  • count (integer) – The value to set the task group count.

Example query:

{
  "jobID": "jobName",
  "taskGroup": "taskGrouName",
  "count": 0
}