Jump to content
We've recently updated our Privacy Statement, available here ×

Scheduling jobs


hlynch

Recommended Posts

I'm trying to setup scheduleing jobs through the rest interface.

Setting up the request involves creating the Job Descriptor to send over.

I've tried to find some docs describing what all is valid to put into the Descriptor, but I've not been successful.

Are there any docs out there on the full definiton of what can be in a Job Descriptor?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi Hlynch, 

Yes there is. I worked in the REST API for schedule job today actually. 
Best reference is the official documentation : JasperReports-Server-REST-API-Reference

Chapter 16 The job Services. 
Listing Report Jobs : is helpfull to do a get on a report that has schedule jobs linked to it. 
So for reference : You can maybe manually create a schedule job. Then do a GET to get the job id
Then do Viewing a Job Definition 
Here you make use of the id and this will return a payload which you can then use as reference. 
I must say schedule jobs description strucutres are the most complicated of all the REST strucutres. 

Content-Type :
application/job+xml or
application/job+json
Content :
A well-formed XML or JSON job descriptor. The request can include either a
complete descriptor such as the result of a GET request described in 16.3,
“Viewing a Job Definition,” on page 132, or it can be a minimally sufficient
descriptor as shown in 16.4, “Scheduling a Report,” on page 136.

Note as in documentation : 
Do a PUSH to create a schedule. 
Do a POST to update with version property.
Ussually it is the otherway around, but not in this case.

Example of one of the GET
GET : https://localhost:8443/jasperserver/rest_v2/jobs?reportUnitURI=path_to_your_given_report_onjasperrepo
HEADER : 
Accpet : application/json
This will return a json payload on a 200.
If you need more, let me know. All of this should be enought to get to going. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...