Skip to content

Latest commit

 

History

History
94 lines (73 loc) · 2.15 KB

08.administration_endpoints.md

File metadata and controls

94 lines (73 loc) · 2.15 KB

Administration Endpoints

List Scheduled Tasks

  • Description: Retrieve a list of all scheduled tasks.
  • Endpoint: GET /scheduler/task
  • Sample Output
[
  {
    "name": "task-1iqz98gc7tg2k-137337807472199",
    "group": "38befbfb-20a3-4bcd-91e1-a2c7240adfa0",
    "consumer": "EmailTaskConsumer",
    "nextFireTime": "2024-06-11T11:53:50",
    "state": "NORMAL",
    "interval": "1d",
    "runs": 17,
    "dataMap": [
      "CC: [[email protected]]",
      "FIELDS: {sender=Sender Name, content=Some dynamic content! Can be a text, a url, etc.}",
      "RECIPIENT_LOCALE: en",
      "RECIPIENT_NAME: person_name_1",
      "RECIPIENT_TARGET: [email protected]",
      "SUBJECT: Something",
      "TASK_ID: 38befbfb-20a3-4bcd-91e1-a2c7240adfa0",
      "TEMPLATE: simple"
    ]
  }
]

List Task Groups

  • Description: Retrieve a list of task groups.
  • Endpoint: GET /scheduler/task/group
  • Sample Output
[
  "38befbfb-20a3-4bcd-91e1-a2c7240adfa0",
  "72512d82-622f-4c3f-9355-990f938c12f7"
]

Pause/Resume Scheduled Tasks

  • Endpoint: POST /scheduler/task/{taskId}/{taskGroup}/pause
  • Endpoint: POST /scheduler/task/{taskId}/{taskGroup}/resume

Sample Output

{
  "totalAffected": 0,
  "alreadyInState": 0,
  "totalTasks": 2,
  "state": "NORMAL"
}

Delete Scheduled Tasks

  • Endpoint: DELETE /scheduler/task
  • Endpoint: DELETE /scheduler/task/{taskId}/{taskGroup}
  • Output: Total number of tasks deleted.

Pause/Resume the Scheduled Service

  • Endpoint: POST /scheduler/pause
  • Endpoint: POST /scheduler/resume

Sample Output

{
  "totalAffected": 0,
  "alreadyInState": 0,
  "totalTasks": 2,
  "state": "RUNNING"
}

Get State of the Scheduled Service

  • Endpoint: POST /scheduler/state
  • Output: RUNNING, PAUSED, STOPPED

Restart (reboot) the Scheduled Service

  • Endpoint: POST /scheduler/restart

Optionally, can specify a boolean parameter to indicate whether actively executing tasks should be interrupted. The default value is false, meaning the scheduler will await for the executing tasks to finish before restarting.