Help Center/ DataArts Insight/ API Reference/ Dataset/ Listing Datasets and Directories
Updated on 2025-02-25 GMT+08:00

Listing Datasets and Directories

Function

This API is used to list datasets.

URI

GET /v1/{project_id}/datasets

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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

name

No

String

Dataset name.

sort_dir

No

String

Whether query results are displayed in descending order.

sort_key

No

String

Sorting field.

limit

No

Integer

Number of returned entries. If not transferred, the first 10 records are queried by default. Value range: [0, 1000]. Default value: 10.

offset

No

Integer

Start offset of returned entries. Value range: [0, 1000]. Default value: 0.

Request Parameters

Table 3 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. Obtain a user token by calling IAM's "Obtaining a User Token" API. X-Subject-Token in the response header is the desired user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

count

Long

Number of data records.

page_data

Array of Table 5 objects

Data.

Table 5 DatasetListVO

Parameter

Type

Description

create_date

Long

Creation time.

create_user

String

Creator ID.

create_user_name

String

Creator name.

description

String

Description.

id

String

ID.

name

String

Name.

permission_list

Array of strings

Current user's sharing and collaboration permissions. The options are edit, export, use, and read.

project_id

String

Project ID.

type

String

Dataset type. The options are:

  • table: dataset consisting of physical tables.
  • sql: dataset that contains custom SQL tables.

update_date

Long

Modification time.

update_user

String

Modifier ID.

update_user_name

String

Modifier name.

workspace_id

String

Workspace ID.

ds_name

String

Name of the bound data source.

ds_type

String

Type of the bound data source. The options are MYSQL, POSTGRESQL, DWS, OPENGAUSS, CLICKHOUSE, API, and DORIS.

ds_id

String

ID of the bound data source.

routing_strategy

String

Routing policy for querying data. The options include Direct (direct connection) and Accelerator (memory engine).

resource_code

String

Dataset resource ID.

Example Request

GET https://{endpoint}/v1/{project_id}/datasets?limit=20&offset=0&sort_dir=desc&name=&create_user_name=&update_user_name=

Example Response

Status code: 200

Datasets and directories are successfully listed.

{ 
  "count" : 216, 
  "page_data" : [ { 
    "id" : "4df79d49-444c-xxxxx-28f9cfeac554", 
    "name" : "Save Dataset", 
    "type" : "table", 
    "permission_list" : [ "edit", "use" ], 
    "workspace_id" : "e77ff0dxxxxxxx1b59fac2cc12faa146f", 
    "project_id" : "34ba64e53a02xxxxxxx75669a8cc17bd", 
    "create_user" : "558def45cexxxxxxxxa20e463e017", 
    "create_user_name" : "xxxxxxxxx", 
    "create_date" : 1704533906073, 
    "update_user" : "558def4xxxxxxxxx648a20e463e017", 
    "update_user_name" : "xxxxxxxx", 
    "update_date" : 1704533906073, 
    "description" : null, 
    "ds_id" : "ff8080818xxxxxxf101886aab31a900e1", 
    "ds_type" : "DWS", 
    "ds_name" : "dws04_public", 
    "routing_strategy" : "Direct", 
    "resource_code" : "xxx" 
  } ] 
}

Status Codes

Status Code

Description

200

Datasets and directories are successfully listed.

Error Codes

See Error Codes.