Skip to content

Conversation

@mmacata
Copy link
Member

@mmacata mmacata commented Jan 7, 2026

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-c9de722a63abaa

HTTP/1.1 405 METHOD NOT ALLOWED

{
    "message": "The method is not allowed for the requested URL."
}

@mmacata mmacata marked this pull request as draft January 7, 2026 16:53
@mmacata mmacata marked this pull request as ready for review January 8, 2026 14:34
@mmacata mmacata requested a review from linakrisztian January 8, 2026 14:41
Copy link
Member

@linakrisztian linakrisztian left a 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}:
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants