Passa al contenuto principale

POST /scheduler/jobs

Crea un job in scheduler_jobs via datahub e poi ricarica la cache runtime.

Request

  • Metodo: POST
  • Path: /scheduler/jobs

Body

Il server accetta sia payload diretto sia formato frontend { job: {...} }.

CampoTipoObbligatorioDescrizione
job_key o jobKeystringSiChiave logica del job.
descriptionstringNoDescrizione job.
enabledboolean/numberNoAbilitazione job (true/1 attivo).
methodstringSiMetodo HTTP target (GET, POST, ...).
urlstringSiURL endpoint da invocare.
headersobjectNoHeader aggiuntivi della chiamata.
bodyobjectNoBody da inviare al target.
timezonestringNoTimezone del job.
timeoutMsnumberNoTimeout richiesta verso target.
openMarketbooleanNoSe true, esegue il job solo a mercato aperto.
exchangesstring[]NoExchange da considerare per openMarket.
retry.maxAttemptsnumberNoNumero massimo retry.
retry.backoffMsnumberNoBackoff retry in millisecondi.

Risposta OK

200 OK

{
"ok": true,
"id": 123,
"job_key": "daily-user-score"
}

Errori

HTTPQuando
500SchedulerCore non inizializzato.
4xx/5xxErrore propagato dalla chiamata a datahub.

Esempio

curl -X POST "http://localhost:3014/scheduler/jobs" \
-H "Content-Type: application/json" \
-d '{
"job": {
"jobKey": "daily-user-score",
"description": "Daily user score compute",
"enabled": true,
"method": "POST",
"url": "http://tickerscanner:3013/internal/fundamentals/user-daily-scores",
"headers": {"x-job-key":"daily-user-score"},
"body": {"scoreDate":"2026-03-03"},
"retry": {"maxAttempts": 3, "backoffMs": 5000}
}
}'