On Sun, Jan 14, 2018 at 11:57 AM, Vincent Massol <[email protected]> wrote:
Hi guys,
I’m trying to use the Job REST API but the doc is pretty poor at http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiRE...
For example to execute a job it says that you only need to pass a “jobType” described as "The type of the job to pass to the Job Executor” … errr what’s the type and what are the valid values? Would be nice to have some example too.
The type is the same job type you have in the Job module document ation at http://extensions.xwiki.org/xwiki/bin/view/Extension/Job+Module#HUseanexisti.... i.e. the hint of the Job component you want to execute, it's not possible to give a list of those types.
Also it doesn’t mention any payload that I have to send but I guess I need to describe the job that I need to execute. What’s the format?
This API document is quite JAX-RS oriented so you can see the class you would send in Java in the "Accepted Media types:" section, here it's JobRequest (complete name being org.xwiki.rest.model.jaxb.JobRequest).
It also says:
“ Since 9.2RC1 jobs started trough the REST API automatically get their runtime context injected with the following REST HTTP request context properties:
• current wiki • current user • request URL and parameters “
What if I want to specify the wiki, user for ex? How do I do that?
Keep in mind you are not reading an Extension module documentation but a Job module one. The namespace(s) where you want to install extensions is indicated in the job request in case of install job.
At the end there are examples of file format at http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiRE... but nothing for jobs.
Yes will need to add a few examples. In the meantime you can see how the JAX-RS XML of an install request looks by asking for the /jobstatus/ of some previous installed extension.
Could someone help improve the doc so that I can try to use it?
Thanks! -Vincent
-- Thomas Mortagne