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
POST end-points for synchronous requests #124
Comments
@jerstlouis why are you under the impressions that /jobs is only for asynchronous requests? A job is not asynchronously executed just because you POST it to /jobs. |
@pvretano What was discussed at the last Members Meeting Open OAB session, and I had also brought that up at the Common SWG meeting, was that So it's from that line of thought that I am suggesting that perhaps It makes very little sense to POST a synchronous execute-request to I also think that having |
@jerstlouis when we discussed the move from /process/{processId}/jobs to /job in the SWG asynchronous execution was not part of the discussion. I was simply an example that I presented as one reason why a non-processes API might want to use a /jobs endpoint. |
@pvretano I understand it was not addressed specifically in the discussion, but now that it lives outside of the
Always POST to
Definitely not, the same one schema :) Another potential advantage of this proposal is that the async job you POST to
I think that could have worked quite well meaning "depending on where you POST it to", if we were to decide to support POSTing it to both places... But that's a different use case of |
@jerstlouis just because you execute a job synchronously, that does not mean that you don't want the results to persist. This is especially true if the transmission mode is set to reference. Having the a job endpoint allows the server to consistently and conveniently persist execution results at /jobs/{jobId}/results/{outputId}. |
@pvretano ah, well that's a good point. In our implementation, for synchronous we would not want to expose the persistence of the results, even if internally we could manage some persistence / caching to accelerate future identical requests. And actually this would allow to point to the exact same output for different requests producing the same results. In general, those sync results are likely to be much more numerous and short-lived than typical async requests. Especially if synchronous execute requests are available for non-authenticated users, it's convenient to not expose them and avoid any privacy issue by not providing a list of jobs / results (as well as to avoid too many results piling up quickly, without any special efforts on the server's part). But I am not suggesting to get rid of the jobs end-point or alter anything concerning the results, just either replacing its POST method by (or adding as an alternative to) a POST method to |
@jerstlouis what you seem to be suggesting is that very late in the game we change the well established execution endpoint from the jobs endpoint to the endpoint that is used by Workflows. Does Workflows not work if it changes its execution endpoint to what is specified in the processes specification? |
@pvretano Not exactly... The well established execution end-point was just changed recently from The Workflows extension was using But considering the recent move to because:
:) And yes Workflows do not work with To some extent this argument would also work for non-Workflows synchronous or asynchronous requests... being able to POST the execute request directly to whatever the "process" URL is I think is quite convenient, if request documents are shared (e.g. for Reusability / Reproduceability -- the R in FAIR!). |
@jerstlouis the move the /jobs is NOT recent. Process execution was always to a "jobs" endpoint (previously /processes/{processId}/jobs and now /jobs) ... and that was the point ... processes execution always involved a job (whether implicitly or explicitly created). |
Fair point about always having a @pvretano Well what I liked very much about the
and Workflows adds:
So the "process" input in Workflows allowing to specify an external process would neatly map to the process identifier / execute end-point in Core, while allowing the "process" object to be recursive/nested in Workflows. I especially liked the |
I expect that a WPS client application can discover the jobs and results independently of the execution mode sync/async. Therefore, I hope that, even if the execution was sync, the client still can access the result at /jobs/{jobId}/result .
Those properties are old fashioned, not in line with RESTful services, and complexifies the implemention for no added value. I expect the API to support two modes:
response (raw/document) and transmissionMode (value,reference) act on the API itself which is not a good idea at all. |
@spacebel With "mode" : "sync", "response" : "raw", "transmissionMode" : "value" the client was never given a While this may not seem practical for batch processing taking a lot of time, it makes tons of sense for processes / small requests expected to complete almost immediately, which is what I expect the synchronous mode would be most useful for. Please don't take away that mode, it's the simplest one by far :) |
@spacebel about the async processing ... agreed! see: https://github.com/opengeospatial/ogcapi-common/tree/master/proposals/simple-async @jerstlouis how exactly is staying with the status quo "taking away that mode"?? OGC API Processes supports synchronous processing and always has. I thought that the current debate is about whether the execution endpoint should be /jobs or /processes/{processesId}. Am I wrong about that? In my opinion, whatever endpoint is chosen for execution it should be a single endpoint regardless of the execution mode (sync or async). Having one execution endpoint for sync and another for async seems unnecessarily complicated. |
@pvretano At the moment OGC API - Processes - Core supports But I was getting the impression that @spacebel would like to remove that functionality. You are correct, this issue is strictly about the execution end-point. |
To my knowledge the "sync" mode (from XML bindings) was not migrated to the REST/JSON API. So the question about how is performed the sync mode seems a good question. Note the sync mode is not async callback, neither the async polling. For the 'sync' mode, the approach should be friendly with the REST philosoph (that you probably know better than me).
In any case, I suppose returning on same endpoint with code 200 two possibles reponse types (status or result) would not be a good practice ? Such pattern was more in line with our good old SOAP/XML... PS: Even in 'sync' mode, you could return a jobId and that would make sense. |
For sync mode, the current details as specified at: http://docs.opengeospatial.org/DRAFTS/18-062.html#_response_6
There is no For |
I would rather say: There is no jobId returned for sync mode in the current spec (which simply translated the XML bindings instead of rethinking the standard for a modern, restful API). Ok fine, but my opinion is still that such options (e.g. response, mode) are absolutely not RESTful. All those modes and options acting on the operation response is exactly what a RESTful micro service should NOT do. My humble personnal point of view :) :) |
All, let's keep in mind that the focus at the moment is on Part 1: Core.
Future extensions may include support for additional approaches such as those discussed in the Pub/Sub whitepaper edited by @sarasaeedi. |
I have just taken note of this proposition through other channels, and I am very against it. I agree with the comment of @spacebel, POST on Since nothing is created on I also agree with @pvretano that I again agree with @pvretano that I would argue also that even a Finally, |
Thanks @fmigneault, we should take this into consideration. I also invite you to our next SWG meeting on March 17, 9 a. EDT to take part in the discussion. |
2021-03-17 SWG (Members) Meeting: We agreed to |
Should be fixed by #159 |
Currently process execution requests are always POSTed to
/jobs
.If
/jobs
becomes a generic OGC API - Common end-point for asynchronous requests, would it make sense to reserve that for asynchronous processing?While POSTing to
/jobs
could still be potentially supported for submitting async requests, proposing to support POST to/processes/{processId}
(also currently the end-point used for Workflows extension).Either only
/processes/{processId}
could be supported, or if the mode is omitted the end-point you POST to could determine a default mode.The text was updated successfully, but these errors were encountered: