Help Center/ DataArts Studio/ API Reference/ Manager API/ Metadata Acquisition/ Obtaining Tables in the Data Source
Updated on 2025-11-17 GMT+08:00

Obtaining Tables in the Data Source

Function

This API is used to obtain tables in the data source.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/{connection_id}/datatables

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

connection_id

Yes

String

Data connection ID, which can be obtained from the data connection list.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

database_name

Yes

String

Database name

table_name

No

String

Names of the tables to be queried

limit

No

String

Maximum number of data records

offset

No

String

Offset

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. This parameter is mandatory for token authentication. Call the "Obtaining the User Token" API of IAM to obtain the value of X-Subject-Token in the response header.

workspace

Yes

String

Workspace ID

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Number of tables in the current database

tables

Array of TablesList objects

List of tables

Table 5 TablesList

Parameter

Type

Description

table_name

String

Table name

table_id

String

ID of a data table

table_name_cn

String

Table name

columns

String

Fields in a table

dw_id

String

Data connection ID.

dw_name

String

Data connection name

dw_type

String

Data connection type

database_name

String

Database name

schema_name

String

Schema name

life_cycle

Integer

Table lifecycle

description

String

Table description

user_id

String

User ID. You can obtain it from the user information on IAM.

user_name

String

Username

project_id

String

Data connection ID.

create_time

String

Table creation time

table_size

Integer

Table size

total_count

Integer

Total number of tables that match the current search criteria

is_valid

Integer

Whether the table is valid

extra_setting

String

Extra settings for the table

partitioned

Boolean

Whether to partition data

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_msg

String

Returned error information.

error_code

String

Returned error code.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Returned error information.

error_code

String

Returned error code.

Example Requests

None

Example Responses

Status code: 200

The list of tables is returned.

{
  "tables" : [ {
    "description" : null,
    "table_id" : "NativeTable-9b18c0ad6ef5404caef4e6cbaccdae6f-postgres-dm_autotest-kuaallfuhe01",
    "table_name" : "kuaallfuhe01",
    "table_name_cn" : null,
    "columns" : null,
    "dw_id" : "9b18c0ad6ef5404caef4e6cbaccdae6f",
    "dw_name" : "dws_xiaoyu",
    "dw_type" : "DWS",
    "database_name" : "postgres",
    "schema_name" : "dm_autotest",
    "life_cycle" : 0,
    "user_id" : "ei_dayu_y00321344_01",
    "user_name" : null,
    "project_id" : null,
    "create_time" : null,
    "table_size" : 0,
    "total_count" : 15,
    "is_valid" : 1,
    "extra_setting" : null,
    "partitioned" : true
  } ],
  "total_count" : 15
}

Status code: 400

Bad request.

{
  "error_code" : "DAYU.4402",
  "error_msg" : "The operation failed, detail msg {0}."
}

Status code: 500

Internal server error.

{
  "error_code" : "DAYU.3531",
  "error_msg" : "Internal server error: {0}"
}

Status Codes

Status Code

Description

200

The list of tables is returned.

400

Bad request.

500

Internal server error.