The resources service lets you browse or search the repository. When used without arguments, it gives the list of resources in the folder specified in the URL. With the arguments, you can search for terms in the resource names or descriptions, search for all resources of a given type, and specify whether to search in subfolders. This service is similar to the list operation in the SOAP web services.
The resources service is a read only service. Requests for PUT, POST, and DELETE operations receive the error 405, method not allowed.
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest/resources/path/to/folder/ | ||
Argument | Type/Value | Description | |
q? | String | Match only resources having the specified text in the name or description. Note that the search string does not match in the ID of resources. | |
type? | wsType | Match only resources of the given type. Valid types are listed in Values for wsType, for example: datasource, reportUnit, img, folder. Searching by type does not always yield the expected results when using newer versions of the server (5.0 and later). New repository types may appear unexpectedly in the results. The v2/resources service resolves this issue, but the (v1) resources service is deprecated and will no longer be updated. | |
recursive? | 0 | 1 | Search for resources recursively and not only in the specified folder. This parameter is used only when a search criteria is specified (either q or type). When not specified, the default is 0, meaning only in the specified folder. Note that searching recursively in the whole repository may cause performance issues, because the number of resources returned may be huge. | |
limit? | Integer >= 0 | Maximum number of items returned to the client. The default is 0, meaning no limit. | |
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The body is XML containing the list of resourceDescriptors. | 404 Not Found – The specified URI is not found in the repository. |
The XML content in the result consists of resourceDescriptors described in section Syntax of resourceDescriptor. However, the list may be empty in the following conditions:
• | If the specified URI is a resource instead of a folder. |
• | If the folder is empty or the search returns no results. |
The following example shows the request to list the resources in the /reports folder:
Because the example is not a recursive search, it simply returns the contents of the folder, in this case a subfolder and a report:
The following sample request is intended to list all the reports available in the /reports folder and subfolders. The result, not shown, is a long list of resourceDescriptors for reports in the designated folders.
Recommended Comments
There are no comments to display.