The GET method is also used for more advanced job searches. Some field of the jobsummary descriptor can be used directly as parameters, and fields of the job descriptor can also be used as search criteria. You can also control the pagination and sorting order of the reply.
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs?<arguments> | ||
Argument | Type/Value | Description | |
label | string | The name of the report job. | |
owner | string | The username of the report job creator; the user who scheduled the report. | |
reportUnitURI? | /path/to/report | Gives the repository URI of a report to list all jobs. When this argument is omitted, this method returns all jobs for all reports. | |
example? | JSON jobModel | Searches for jobs that match the JSON jobModel. The jobModel is a fragment of a job descriptor containing one or more fields to be matched. | |
numberOf Rows | integer | Turns on pagination of the result by specifying the number of jobsummary descriptors per results page. | |
startIndex | integer | Determines the page number in paginated results by specifying the index of the first jobsummary to be returned. | |
sortType |
| Possible values are: NONE, SORTBY_JOBID, SORTBY_JOBNAME, SORTBY_REPORTURI, SORTBY_REPORTNAME, SORTBY_REPORTFOLDER, SORTBY_OWNER, SORTBY_STATUS, SORTBY_LASTRUN, SORTBY_NEXTRUN | |
isAscending | true / false | Determines the sort order: ascending if true, descending if false or omitted. | |
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The body contains XML that describes jobs in the scheduler that match the search criteria. | 404 Not Found – When the specified report is not found in the server. |
The body of the return value is an XML jobs descriptor containing jobsummary descriptors, as shown in section Listing Report Jobs.
The example parameter lets you specify a search on fields in the job descriptor, such as output formats. Some fields may be specified in both the example parameter and in a dedicated parameter, for example label. In that case, the search specified in the example parameter takes precedence.
For example, you can search for all jobs that specify and output format of PDF. The JSON string to specify this field is:
{"outputFormat":"PDF"}
And the corresponding URI, with proper encoding, is:
http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs?example=%7b%22outputFormat%22%3a%22PDF%22%7d
Recommended Comments
There are no comments to display.