Scheduler
  • Scheduler
  • Job types
    • Http
    • Exec
    • Pipes
  • Examples
Powered by GitBook
On this page
  • Introduction
  • Configuration
  • Job Definitions

Scheduler

Introduction

Module for scheduling jobs.

Configuration

Module name: Scheduler

Name
Description

jobs

List of job definitions (see below)

{
  "enabled": true,
  "jobs": [
    {
      "id": "job01",
      "type": "Pipes",
      "schedule": "0 0 9 ? * MON-FRI",
      "params": {
        "pipe_id": "pipe01",
        "param01": "value01"
      }
    }
  ]
}

Job Definitions

Name
Description

id

Job identifier. Must be configuration unique.

type

Job type.

schedule

Job schedule in cron format

params

Job parameters hash/dictionary.

{
  "id": "job01",
  "type": "NoOp",
  "schedule": "* * * * * ?",
  "params": {
    "param01": "string",
    "param02": 99,
    "param03": true
    }
}

Schedules

Schedules are defined using a CRON like expression consisting of six or seven fields:

  1. Seconds (0-59)

  2. Minutes (0-59)

  3. Hours (0-23)

  4. Day of month (1-31)

  5. Month (1-12 or JAN-DEC)

  6. Day of week (1-7 or SUN-SAT)

  7. Year (optional field, such as 2023)

Where each field in the cron expression denotes a specific unit of time.

To run a job to run at 10:30 every day, the cron expression would be:

"0 30 10 ? * *"

  • 0 in the first field represents seconds.

  • 30 in the second field represents minutes (at 30 minutes past the hour).

  • 10 in the third field represents hours (at 10 AM).

  • ? in the fourth field signifies no specific day of the month.

  • * in the fifth field indicates no specific month.

  • * in the sixth field indicates every day of the week.

Job types

The following types of jobs are available:

Type
Description

Pipes

Executes a configured pipe with parameters

Http

Calls an URL with configurable method, headers and parameters.

Exec

Executes a system command

Custom job types can be added by implementing:

foss.platform.api.scheduler.Action

and making implementation and dependencies available to server.

NextJob types

Last updated 1 year ago