Help Center/ DataArts Insight/ API Reference/ Resource Migration/ Exporting a Resource Package Using an API
Updated on 2025-02-25 GMT+08:00

Exporting a Resource Package Using an API

Function

This API is used to export resource packages.

URI

POST /v1/{project_id}/resource-package/export

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

For how to obtain a project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Workspace-Id

Yes

String

Workspace ID. For how to obtain it, see Obtaining a Workspace ID.

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the exported package.

export_param

No

ResourcePackageExportParam object

Exported advanced parameters.

resources

Yes

Array of objects

Details about exported resources.

Table 4 ResourcePackageExportParam

Parameter

Mandatory

Type

Description

export_dataset_tag_permission

No

Boolean

Whether the resource package includes dataset row permissions and tag-based authorization.

Table 5 resources

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Explanation

Enumerated value of the resource type, which is used to specify the type of the authorized object.

For example, datasource indicates that the type of the authorized object is a data source.

Constraints

N/A

Value range

The enumerated values are:

  • datasource: data source.
  • dataset: dataset.
  • metric: indicator.
  • dashboard: dashboard.
  • screen: large screen.
  • embedAnalysis: embedded analytics.
  • portal: data portal.
  • subject: intelligent analysis assistant.

Default value

N/A

resource_id

Yes

String

Resource ID.

Response Parameters

Table 6 Response body parameter

Parameter

Type

Description

-

File

File stream.

Example Request

POST https://{endpoint}/v1/{project_id}/resource-package/export
{
  "name": "Unnamed Resource Package",
  "resources" : [ {
    "resource_type" : "datasource",
    "resource_id" : "12awedqweqweqwe"
  } ]
}

Example Response

None

Status Codes

Table 7 Status code

Status Code

Description

200

File stream.

Error Codes

See Error Codes.