workers

Asynchronous workers related operations

List all scheduled jobs

get
Paramètres d'en-tête
X-Fieldsstring · maskOptionnel

An optional fields mask

Réponses
200
Success
application/json
get
GET /api/1/workers/jobs/ HTTP/1.1
Host: www.data.gouv.fr
Accept: */*
200

Success

[
  {
    "args": [
      {}
    ],
    "crontab": {
      "day_of_month": "*",
      "day_of_week": "*",
      "hour": "*",
      "minute": "*",
      "month_of_year": "*"
    },
    "description": "text",
    "enabled": false,
    "id": "text",
    "interval": {
      "every": 1,
      "period": "days"
    },
    "kwargs": {},
    "last_run_at": "2025-06-30T19:32:41.658Z",
    "last_run_id": "text",
    "name": "text",
    "schedule": "text",
    "task": "test-high-queue"
  }
]

Create a new scheduled job

post
Paramètres d'en-tête
X-Fieldsstring · maskOptionnel

An optional fields mask

Corps
argsobject[]Optionnel

The job execution arguments

Default: []
descriptionstringOptionnel

The job description

enabledbooleanOptionnel

Is this job enabled

Default: false
idstringLecture seuleOptionnel

The job unique identifier

kwargsobjectOptionnel

The job execution keyword arguments

Default: {}
last_run_atstring · date-timeLecture seuleOptionnel

The last job execution date

last_run_idstringLecture seuleOptionnel

The last execution task id

namestringRequis

The job unique name

schedulestringLecture seuleOptionnel

The schedule display

taskstring · enumRequis

The task name

Example: test-high-queueValeurs possibles:
Réponses
200
Success
application/json
post
POST /api/1/workers/jobs/ HTTP/1.1
Host: www.data.gouv.fr
Content-Type: application/json
Accept: */*
Content-Length: 233

{
  "args": [
    {}
  ],
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "interval": {
    "every": 1,
    "period": "days"
  },
  "kwargs": {},
  "name": "text",
  "task": "test-high-queue"
}
200

Success

{
  "args": [
    {}
  ],
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "id": "text",
  "interval": {
    "every": 1,
    "period": "days"
  },
  "kwargs": {},
  "last_run_at": "2025-06-30T19:32:41.658Z",
  "last_run_id": "text",
  "name": "text",
  "schedule": "text",
  "task": "test-high-queue"
}

List all schedulable jobs

get
Réponses
200
Success
application/json
Réponsestring[]
get
GET /api/1/workers/jobs/schedulables HTTP/1.1
Host: www.data.gouv.fr
Accept: */*
200

Success

[
  "text"
]

Fetch a single scheduled job

get
Paramètres de chemin
idanyRequis

A job ID

Paramètres d'en-tête
X-Fieldsstring · maskOptionnel

An optional fields mask

Réponses
200
Success
application/json
get
GET /api/1/workers/jobs/{id} HTTP/1.1
Host: www.data.gouv.fr
Accept: */*
200

Success

{
  "args": [
    {}
  ],
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "id": "text",
  "interval": {
    "every": 1,
    "period": "days"
  },
  "kwargs": {},
  "last_run_at": "2025-06-30T19:32:41.658Z",
  "last_run_id": "text",
  "name": "text",
  "schedule": "text",
  "task": "test-high-queue"
}

Update a single scheduled job

put
Paramètres de chemin
idanyRequis

A job ID

Paramètres d'en-tête
X-Fieldsstring · maskOptionnel

An optional fields mask

Réponses
200
Success
application/json
put
PUT /api/1/workers/jobs/{id} HTTP/1.1
Host: www.data.gouv.fr
Accept: */*
200

Success

{
  "args": [
    {}
  ],
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "id": "text",
  "interval": {
    "every": 1,
    "period": "days"
  },
  "kwargs": {},
  "last_run_at": "2025-06-30T19:32:41.658Z",
  "last_run_id": "text",
  "name": "text",
  "schedule": "text",
  "task": "test-high-queue"
}

Delete a single scheduled job

delete
Paramètres de chemin
idanyRequis

A job ID

Réponses
204
Successfuly deleted
delete
DELETE /api/1/workers/jobs/{id} HTTP/1.1
Host: www.data.gouv.fr
Accept: */*
204

Successfuly deleted

Aucun contenu

Get a tasks status given its ID

get
Paramètres de chemin
idanyRequis
Paramètres d'en-tête
X-Fieldsstring · maskOptionnel

An optional fields mask

Réponses
200
Success
application/json
get
GET /api/1/workers/tasks/{id} HTTP/1.1
Host: www.data.gouv.fr
Accept: */*
200

Success

{
  "exc": "text",
  "id": "text",
  "result": "text",
  "status": "RECEIVED",
  "traceback": "text"
}

Dernière mise à jour

Cet article vous a-t-il été utile ?