Articles in this section

How to manage a job lifecycle?

These routes are available starting from CalderaConnect (Caldera REST API) v2.2.0.

This article describes the file-oriented job routes available in recent versions of CalderaConnect to:

  • Abort, release, or delete jobs
  • Retrieve thumbnails and previews
  • And import or export jobs

Use them when a job already exists and you need to inspect it or change its state.

 

Get one job

GET http://localhost:12340/v1/jobs/{jobId}
curl 'http://localhost:12340/v1/jobs/{jobId}'

 

Abort, Release, or Delete Jobs

Abort a running job

POST http://localhost:12340/v1/jobs/{jobId}/abort
curl --request POST \
 --url http://localhost:12340/v1/jobs/{jobId}/abort \
 --header 'Accept: application/json'

Possible results:

  • 200 when the job was aborted and the updated job is returned
  • 204 when the job was already aborted

 

Release a blocked job

POST http://localhost:12340/v1/jobs/{jobId}/release
curl --request POST \
 --url http://localhost:12340/v1/jobs/{jobId}/release \
 --header 'Accept: application/json'

 

Delete a job

DELETE http://localhost:12340/v1/jobs/{jobId}
curl --request DELETE \
 --url http://localhost:12340/v1/jobs/{jobId}

 

Common errors

  • 404 when the job cannot be found
  • 502 when a remote server reports an error

 

Thumbnails and Previews

Download a thumbnail

This route returns a PNG thumbnail.

GET http://localhost:12340/v1/jobs/{jobId}/thumbnail
curl --request GET \
 --url http://localhost:12340/v1/jobs/{jobId}/thumbnail \
 --output thumbnail.png

 

Download a preview stream

This route returns as a stream response.

GET http://localhost:12340/v1/jobs/{jobId}/preview
curl --request GET
 --url http://localhost:12340/v1/jobs/{jobId}/preview \
 --output preview.bin

 

Import or Export

Import a job archive

curl --request POST \
 --url 'http://localhost:12340/v1/jobs/import?deviceId={deviceId}' \
 --header 'Accept: application/json' \
 --form 'file=@job.caljob' \
 --form 'fileType=CALJOB_BASE' \
 --form 'fileSize=204800'

Supported import file types in the 2.2 description:

  • CALJOB_BASE
  • CALJOB_WITH_RIP
  • CALJOB_WITH_SRC
  • CALJOB_WITH_RIP_AND_SRC

 

Export a job archive

curl --request GET \
 --url 'http://localhost:12340/v1/jobs/{jobId}/export?includeRippedFiles=false&includeSourceFiles=false' \
 --output job.caljob

Optional query parameters:

  • includeRippedFiles
  • includeSourceFiles

 

Common errors

  • 400 for invalid multipart fields
  • 404 if the target device cannot be found or reached
  • 502 if the remote RIP fails to import the archive

 

Was this article helpful?
0 out of 0 found this helpful