workers

Asynchronous workers related operations

List all scheduled jobs

get

/workers/jobs/

Header parameters
X-Fieldsstring · mask

An optional fields mask

Responses
curl -L \
  --url '//www.data.gouv.fr/api/1/workers/jobs/'
[
  {
    "crontab": {
      "day_of_month": "*",
      "day_of_week": "*",
      "hour": "*",
      "minute": "*",
      "month_of_year": "*"
    },
    "description": "text",
    "enabled": false,
    "id": "text",
    "interval": {
      "every": 1,
      "period": "days"
    },
    "last_run_at": "2025-02-22T13:20:24.411Z",
    "last_run_id": "text",
    "name": "text",
    "schedule": "text",
    "task": "test-high-queue",
    "kwargs": {},
    "args": []
  }
]

Create a new scheduled job

post

/workers/jobs/

Header parameters
X-Fieldsstring · mask

An optional fields mask

Body
crontabobject
descriptionstring

The job description

enabledboolean

Is this job enabled

idstring

The job unique identifier

intervalobject
last_run_atstring · date-time

The last job execution date

last_run_idstring

The last execution task id

namestringrequired

The job unique name

schedulestring

The schedule display

taskstring · enumrequired

The task name

Example: test-high-queue
Options: test-high-queue, test-default-queue, purge-datasets, bind-tabular-dataservice, compute-site-metrics, send-frequency-reminder, map-transport-datasets, purge-chunks, compute-geozones-metrics, count-tags, test-error, recommendations-clean, update-datasets-reuses-metrics, purge-organizations, recommendations-add, purge-reuses, test-log, harvest, update-metrics, piwik-bulk-track-api, test-low-queue, purge-harvesters, check-integrity, purge-harvest-jobs, export-csv
kwargsobject · default: [object Object]

The job execution keyword arguments

argsobject[] · default:

The job execution arguments

Responses
curl -L \
  --request POST \
  --url '//www.data.gouv.fr/api/1/workers/jobs/' \
  --header 'Content-Type: application/json' \
  --data '{"crontab":{"day_of_month":"*","day_of_week":"*","hour":"*","minute":"*","month_of_year":"*"},"enabled":false,"interval":{"every":1,"period":"days"},"name":"text","task":"test-high-queue","kwargs":{},"args":[]}'
{
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "id": "text",
  "interval": {
    "every": 1,
    "period": "days"
  },
  "last_run_at": "2025-02-22T13:20:24.411Z",
  "last_run_id": "text",
  "name": "text",
  "schedule": "text",
  "task": "test-high-queue",
  "kwargs": {},
  "args": []
}

List all schedulable jobs

get

/workers/jobs/schedulables

Responses
curl -L \
  --url '//www.data.gouv.fr/api/1/workers/jobs/schedulables'
[
  "text"
]

Fetch a single scheduled job

get

/workers/jobs/{id}

Path parameters
idstringrequired

A job ID

Header parameters
X-Fieldsstring · mask

An optional fields mask

Responses
curl -L \
  --url '//www.data.gouv.fr/api/1/workers/jobs/{id}'
{
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "id": "text",
  "interval": {
    "every": 1,
    "period": "days"
  },
  "last_run_at": "2025-02-22T13:20:24.411Z",
  "last_run_id": "text",
  "name": "text",
  "schedule": "text",
  "task": "test-high-queue",
  "kwargs": {},
  "args": []
}

Update a single scheduled job

put

/workers/jobs/{id}

Path parameters
idstringrequired

A job ID

Header parameters
X-Fieldsstring · mask

An optional fields mask

Responses
curl -L \
  --request PUT \
  --url '//www.data.gouv.fr/api/1/workers/jobs/{id}'
{
  "crontab": {
    "day_of_month": "*",
    "day_of_week": "*",
    "hour": "*",
    "minute": "*",
    "month_of_year": "*"
  },
  "description": "text",
  "enabled": false,
  "id": "text",
  "interval": {
    "every": 1,
    "period": "days"
  },
  "last_run_at": "2025-02-22T13:20:24.411Z",
  "last_run_id": "text",
  "name": "text",
  "schedule": "text",
  "task": "test-high-queue",
  "kwargs": {},
  "args": []
}

Delete a single scheduled job

delete

/workers/jobs/{id}

Path parameters
idstringrequired

A job ID

Responses
curl -L \
  --request DELETE \
  --url '//www.data.gouv.fr/api/1/workers/jobs/{id}'

No body

Get a tasks status given its ID

get

/workers/tasks/{id}

Path parameters
idstringrequired
Header parameters
X-Fieldsstring · mask

An optional fields mask

Responses
curl -L \
  --url '//www.data.gouv.fr/api/1/workers/tasks/{id}'
{
  "exc": "text",
  "id": "text",
  "result": "text",
  "traceback": "text",
  "status": "FAILURE"
}

Dernière mise à jour

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


Revision created

Update faq-cadastre.md