Aller au contenu principal

Jobs

Choisissez votre langage :

Long-running operations return a job. Use client.jobs to inspect or wait for those operations.

client.jobs.get(jobId)

Read a public async job by id or task id.

SDKclient.jobs.get(job_id)
RetourneJobRef

Parameters:

EmplacementParamètreTypeRequisDescription
Pathjob_idstringRequisJob id or task id returned by an async operation.

Return fields:

FieldTypeDescription
idstringJob id.
typestringJob type, for example test_plan_generation, evaluation or agent_run.
statusstringCurrent job status.
resourceobjectRelated ids such as system_id, evaluation_id, agent_id or run_id.
task_idstringBackground task id when available.
resultanyJob result when available.
errorstringError message when available.

client.jobs.wait(jobId, options)

SDK helper that polls client.jobs.get(...) until the job reaches a terminal state.

SDKclient.jobs.wait(job_id, timeout_ms=..., interval_ms=..., on_poll=None)
Retournejob.result when present, otherwise JobRef

Parameters:

EmplacementParamètreTypeRequisDéfautDescription
SDKjob_idstringRequisJob id or task id.
SDKtimeout_msintegerOptionnel900000Maximum wait time in milliseconds.
SDKinterval_msintegerOptionnel5000Poll interval in milliseconds.
SDKon_pollcallableOptionnelCallback called with each job payload.

Raises PollTimeoutError on timeout and JobFailedError if the terminal job status is failed, canceled or timed out.