-
Notifications
You must be signed in to change notification settings - Fork 0
Add job status info endpoint #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
linakrisztian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, especially the detailed tests!
| resp = get_actinia_job(job_id) | ||
|
|
||
| status_code = resp.status_code | ||
| if status_code not in {200, 400}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and what happens afterwards if status_code=400?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An internal server error 🙃
Good catch, this was a first approach before I updated actinia-org/actinia-core#685 and then I had no 400 case locally. I updated it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Changed again to also take into account that actinia responds with a 400 for a resource with error.)
This PR adds an HTTP GET endpoint to retrieve Job status information at
/jobs/{jobID}Example:
http://localhost:4044/jobs/96ed4cb9-1290-4409-b034-c162759c10a1{ "processID": "resource_id-96ed4cb9-1290-4409-b034-c162759c10a1", "type": "process", "jobID": "96ed4cb9-1290-4409-b034-c162759c10a1", "status": "successful", "message": "Processing successfully finished", "created": "2026-01-06T11:02:14+00:00", "finished": "2026-01-06T11:02:49+00:00", "updated": "2026-01-06T11:02:49+00:00", "progress": 100, "links": [ { "href": "http://localhost:4044/jobs/96ed4cb9-1290-4409-b034-c162759c10a1", "rel": "self" } ] }It also updates the configured port - if deployed next to the actinia-cloudevent-plugin, the same port is not used twice.
More examples for responses:
accepted
http://localhost:4044/jobs/3ce221d4-5195-4fec-a28f-917b98248874
{ "processID": "resource_id-3ce221d4-5195-4fec-a28f-917b98248874", "type": "process", "jobID": "3ce221d4-5195-4fec-a28f-917b98248874", "status": "accepted", "message": "Resource accepted", "created": "2025-12-19T11:34:11+00:00", "updated": "2025-12-19T11:34:12+00:00", "links": [ { "href": "http://localhost:4044/jobs/3ce221d4-5195-4fec-a28f-917b98248874", "rel": "self" } ] }running
http://localhost:4044/jobs/d63dcd9e-4914-4989-a47e-c9de722a63ab
{ "processID": "resource_id-d63dcd9e-4914-4989-a47e-c9de722a63ab", "type": "process", "jobID": "d63dcd9e-4914-4989-a47e-c9de722a63ab", "status": "running", "message": "Running executable sleep with parameters ['28800'] for 1640.5341715812683 seconds", "created": "2026-01-08T09:07:08+00:00", "updated": "2026-01-08T09:35:55+00:00", "progress": 50, "links": [ { "href": "http://localhost:4044/jobs/d63dcd9e-4914-4989-a47e-c9de722a63ab", "rel": "self" } ] }successful
http://localhost:4044/jobs/96ed4cb9-1290-4409-b034-c162759c10a1
{ "processID": "resource_id-96ed4cb9-1290-4409-b034-c162759c10a1", "type": "process", "jobID": "96ed4cb9-1290-4409-b034-c162759c10a1", "status": "successful", "message": "Processing successfully finished", "created": "2026-01-06T11:02:14+00:00", "finished": "2026-01-06T11:02:49+00:00", "updated": "2026-01-06T11:02:49+00:00", "progress": 100, "links": [ { "href": "http://localhost:4044/jobs/96ed4cb9-1290-4409-b034-c162759c10a1", "rel": "self" } ] }failed
http://localhost:4044/jobs/565f6bc9-7535-44c6-9826-864fbb2421f3
{ "processID": "resource_id-565f6bc9-7535-44c6-9826-864fbb2421f3", "type": "process", "jobID": "565f6bc9-7535-44c6-9826-864fbb2421f3", "status": "failed", "message": "AsyncProcessError: Error while running executable <v.buffer>", "created": "2026-01-08T09:40:08+00:00", "updated": "2026-01-08T09:42:07+00:00", "progress": 50, "links": [ { "href": "http://localhost:4044/jobs/565f6bc9-7535-44c6-9826-864fbb2421f3", "rel": "self" } ] }dismissed
http://localhost:4044/jobs/d277ea36-1f84-467d-94fa-cc8c9a183dc8
{ "processID": "resource_id-d277ea36-1f84-467d-94fa-cc8c9a183dc8", "type": "process", "jobID": "d277ea36-1f84-467d-94fa-cc8c9a183dc8", "status": "dismissed", "message": "AsyncProcessTermination: Process <sleep> was terminated by user request", "created": "2026-01-08T09:55:37+00:00", "updated": "2026-01-08T09:56:45+00:00", "progress": 50, "links": [ { "href": "http://localhost:4044/jobs/d277ea36-1f84-467d-94fa-cc8c9a183dc8", "rel": "self" } ] }404
(
Requires actinia-org/actinia-core#685-> Works for actinia returning 400 or 404)http://localhost:4044/jobs/non_existing_job
{ "type": "http://www.opengis.net/def/exceptions/ogcapi-processes-1/1.0/no-such-job", "title": "No Such Job", "status": 404, "detail": "Job 'd63dcd9e-4914-4989-a47e-c9de722a63abaa' not found" }401
curl -u wrong-user:wrong-pw http://localhost:4044/jobs/d63dcd9e-4914-4989-a47e-c9de722a63ab{ "status": 401, "message": "ERROR: Unauthorized Access" }405
curl -i -X POST -u actinia-gdi:actinia-gdi http://localhost:4044/jobs/d63dcd9e-4914-4989-a47e-c9de722a63abaaHTTP/1.1 405 METHOD NOT ALLOWED