JSON API Method to update the job's progress
See original GitHub issueHello all,
Thank for this awesome tool. I have patched the code in order to modify with JSON API the jobs’s progress
Sorry i feel unconfortable with git so I copy/paste my code here.
In ./lib/http/routes/json.js
/**
* Update job :id :frames :totalFrames.
*/
exports.updateProgress = function(req, res){
var id = req.params.id
, frames = req.params.frames , totalFrames = req.params.totalFrames;
Job.get(id, function(err, job){
if (err) return res.send({ error: err.message });
job.progress(frames, totalFrames);
job.save(function(err){
if (err) return res.send({ error: err.message });
res.send({ message: 'updated Progress' });
});
});
};
And in ./lib/http/index.js
app.put('/job/:id/progress/:frames..:totalFrames', provides('json'), json.updateProgress);
Here an example:
curl -X PUT “http://domain:port/job/163/progress/1200…3000”
Sorry for my english.
Issue Analytics
- State:
- Created 10 years ago
- Comments:6
Top Results From Across the Web
Update Job (for data collection and evaluation) - TechDocs
Update Job (for data collection and evaluation). Last Updated October 2, 2022. Use this API to update a job in which a technical...
Read more >how to get progress bar data for a running jenkins job through ...
I can find information on the last build ( .../job/MyJob/lastBuild/api/xml ) but I'm not seeing the field(s) that would let me create a...
Read more >REST API - Chronos
You can communicate with Chronos using a RESTful JSON API over HTTP. ... Scheduled Job; Adding a Dependent Job; Adding a Docker Job;...
Read more >Jobs, Tasks, and Schedules Methods - Tableau Help
Using the jobs, tasks, and schedules methods of the Tableau Server REST API you can do the operations listed in the following categories:...
Read more >Jobs - Update - REST API (Azure Media Services)
Update Job Update is only supported for description and priority. ... The progress and state can be obtained by polling a Job or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@behrad I don’t agree with you. It’s very useful feature.
Right now JSON API is completely unuseful and it’s sad. Kue as a stand-alone (micro-)service is much more preferable than just a nodejs module. And it’s simple to move Kue this way - just make JSON API more powerful.
This is unusual feature, since kue job processors are in nodejs, and worker is the one how can change job’s progress. If you are using a bridged PHP/Java/XYZ handler, you can also define a bridge between your nodejs processor and your PHP script to update the job’s progress within the your nodejs code.