NCATSTranslator / ReasonerAPI

NCATS Biomedical Translator Reasoners Standard API
35 stars 28 forks source link

Draft of status check for async_query #395

Closed edeutsch closed 1 year ago

edeutsch commented 1 year ago

This PR proposes a standardized mechanism for the ARS to ask an ARA how a previously submitted async_query is going, most importantly to ascertain if work is still ongoing or if the process has died mysteriously and there will never be an answer.

/async_query MUST return something like:

{
  "job_id": "rXEOAosN3L",
  <<<additionalAttributes: true>>>
}

(a full TRAPI Response is permitted as long as "job_id" is added)

And then /async_query_status/rXEOAosN3L MUST return something like:

{
  "status": "Running",    "Queued | Running | Completed | Failed",                 (required. reused from TRAPI Response)
  "description": "Callback url was not provided",                            (required. reused from TRAPI Response)
  "response_url": "http://server/response/fulltrapi",                  (optional)
  "logs": [                                                        (required. reused from TRAPI Response)
    {
      "code": "",
      "level": "DEBUG",
      "message": "in query_return_message",
      "timestamp": "2023-01-27T18:16:27.099285"
    },
...
    {
      "code": "",
      "level": "INFO",
      "message": "Everything seems in order to begin processing the query asynchronously. Processing will continue and Response will be posted to https://somelocation/api/arax/v1.3/callback/393809248",
      "timestamp": "2023-01-27T18:16:31.583591"
    }
  ],
  <<<additionalAttributes: true>>>
}