Nexrender: Add an option to return less data when getting jobs from API

Created on 25 Jun 2020  路  5Comments  路  Source: inlife/nexrender

Is your feature request related to a problem? Please describe.
Use Case: I create jobs via API and provide base64-encoded assets. Then, I poll the nexrender-server every N seconds to get the job statuses. At every request, the whole base64 is sent back to my server which is maybe too much bandwidth consumed for nothing.

Describe the solution you'd like
A query param, or another route to fetch jobs, returning only their uid and metadata (completion, state, etc...).
Maybe something like /api/v1/job-statuses

If the solution sounds OK to you, I can start working on a PR soon enough

feature

Most helpful comment

Published as v1.19.2

All 5 comments

Yes, the solution sounds ok, that is something we've had problems already with for some users.
Alternatively, thinking about it, it makes sense to do that meta-only response not only for "get all" but for "get single" and "update single" requests as well. Especially since the latter one is what received by a worker each time he sends an update with progress. Won't you agree?

What you think about some sort of a parallel API that would do that, maybe something like:

* GET /v1/jobs/status
* GET /v1/jobs/{uid}/status
* PUT /v1/jobs/{uid}/status

Not entirely sure about naming thing tho. If you have other suggestions, please do share!
Also, sorry for the slow response.

Hi,

Sorry for the slow response too, I was on vacations ;)

I really like your proposal and the naming you chose. I think I'll start working on an implementation this weekend. I'll keep you updated

I (finally) made a PR here: https://github.com/inlife/nexrender/pull/469 (don't know why it wasn't automatically linked)

I didn't implement PUT /v1/jobs/{uid}/status on the server side because it seemed to be already covered by the standard update route. However I edited the worker to send the 'lightweight' version of the job when updating status.

Unfortunately I could not exhaustively test the worker but the API works OK

Hey

I think it's looking good, lets see how it is going to feel as well.
Going to publish a new release. :)

Published as v1.19.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

whatneuron picture whatneuron  路  3Comments

danielgwilson picture danielgwilson  路  3Comments

joshea0 picture joshea0  路  5Comments

darshak-gosar picture darshak-gosar  路  3Comments

senthudms picture senthudms  路  3Comments