The export service works asynchronously: first you request the export with the desired options, then you monitor the state of the export, and finally you request the output file. Each step requires a different service call. You must be authenticated as the system admin (superuser) for the export services.
Method | URL | ||
POST | http://<host>:<port>/jasperserver[-pro]/rest_v2/export/ | ||
Content-Type | Content | ||
application/json | A JSON object that describes the export options. | ||
Return Value on Success | Typical Return Values on Failure | ||
200 OK – Returns a JSON object that gives the ID of the started export operation. | 401 Unauthorized – Export is available only to the system admin user (superuser). |
The content to send describes the export options, for example:
{ roles: ["ROLE_USER","ROLE_MANAGER|organization_1"], users: ["superuser","joeuser|organization_1"], uris: ["/public/Samples/Reports/AllAccounts", "/organizations/organization_1/reports/Survey/Survey_Data"] parameters: ["role-users", "repository-permissions"]}[/code] |
As shown above, commercial editions must use the organization syntax for all roles, users, and URIs.
The following table describes the options you can list in the request.
Export Options | |
---|---|
roles | A list of role names to export. Specify the role-users parameter to also export all users who have these roles. |
users | A list of user names to export. |
uris | A list of resoures or folders to export, specified as repository URIs. When a folder is specified, all its contents and all its subfolders recursively are included. To export all resources in the repository or in an organization, specify "/" (root) in this list. When you specify an organization ID below, the URIs in this list are all relative to the organization. |
scheduledJobs | A list of report URIs for which all scheduled jobs are exported. If you specify a folder URIs, the scheduled jobs for all reports in the folder, recursively, are exported. |
resourceTypes | A list of resource types that filters any selected resources for export. When omitted, all resources specified by URI or folder URI are exported. When specified, only the resource types in this list are exported. |
organization | A single organization ID that determines a branch of the repository for export. When this option is specified, this organization becomes the root for all roles, users, and uris to be listed for export. |
parameters | A list of parameters that act as flags: if specified, the corresponding action is taken, if omitted they have no effect. The the following table. |
The following table describes the export parameters:
Export Parameters |
|
everything | Export everything except audit and monitoring: all repository resources, permissions, report jobs, users, roles, and server settings. |
role-users | When specified, each role export triggers the export of all users belonging to the role. This option should only be used if roles are specified |
repository-permissions | When specified, repository permissions are exported along with each exported folder and resource. This option should only be used if uris are specified. |
skip-dependent-resources | When specified, only the resources specified by URIs are exported, no dependent resources such as data sources, queries, or files included by reference are exported. This will create broken dependencies during import unless the the same dependencies already exist in the same relative locations in the destination. |
skip-suborganizations | When specified, the export will omit all the items such as roles, users, and resources that belong to suborganizations, even they are directly specified using the corresponding options. When no organization ID is specified, this flag applies to the root such that no top-level organizations are included in the export, only the contents of the root. |
include-attributes | Includes all attributes that are associated with a item being exported, such as a user, an organization, or the root. |
skip-attribute-values | When specified with include-attributes, only attribute names are exported with null values. Use this to prevent applying attributes that are specific to one server or one organization. |
include-server-settings | When specified, the configuration and security settings on the server are exported. When imported into another server, these settings will take effect immediately. |
include-access-events | When specified, access events (date, time, and user name of last modification) are exported along with each exported folder and resource. This option should only be used if uris are specified. |
include-audit-events | Include audit data for all resources and users in the export. The audit feature must be enabled in the server configuration. |
include-monitoring-events | Include monitoring events. The monitoring feature must be enabled in the server configuration. |
The body of the response contains the ID of the export operation needed to check its status and later download the file:
The response may also warn you of any broken dependencies in the export that may affect a future import operation:
Recommended Comments
There are no comments to display.