Help Center/ DataArts Insight/ API Reference/ Data Source/ Obtaining Data Source Details
Updated on 2025-02-25 GMT+08:00

Obtaining Data Source Details

Function

This API is used to obtain data source details.

URI

GET /v1/{project_id}/connections/{connection_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

connection_id

Yes

String

Data source 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. 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 3 Response body parameters

Parameter

Type

Description

id

String

Data source ID.

name

String

Data source name.

description

String

Data source description.

host

String

IP address or domain name of the data source.

port

Integer

Port.

server_list

String

Service list.

database_name

String

Database name.

user_name

String

Username.

url

String

JDBC URL.

test_url

String

JDBC test URL.

password

String

Password for connecting to a database.

source_instance_id

String

ID of the associated cloud instance.

vpc_connection_id

String

VPC connection ID of the associated cloud instance.

project_id

String

Project ID.

domain_id

String

User domain ID.

region_id

String

Region ID.

work_space_id

String

Workspace ID.

extra

String

Network configuration information.

config

DcConfigVO object

Configuration information.

type

String

Explanation

Data source type.

For example, MySQL indicates that the type of the connected data source is MySQL. The MySQL driver package is used for query.

Constraints

N/A

Value range

The enumerated values are:

  • MySQL.
  • DWS: data source type corresponding to GaussDB(DWS).
  • PostgreSQL.
  • OpenGauss: data source type corresponding to GaussDB.
  • Doris.
  • HIVE.
  • ClickHouse.
  • API: data source type corresponding to API data.

Default value

N/A

source

String

Data source. Enumerated values:

  • rds: RDS data source.
  • dws: GaussDB(DWS) data source.
  • mrs: MRS data source.
  • gaussdb: GaussDB data source.
  • public: public network data source.
  • restapi: API data source.
  • endpoint-service: VPCEP data source.

mode

String

Schema.

default_schema

String

Default schema.

Table 4 DcConfigVO

Parameter

Type

Description

ssl

Boolean

SSL parameter configuration.

region_id

String

ID of the region where DLI is. Currently, cross-region deployment is not supported. The value must be the ID of the current region.

catalog_name

String

Data directory name. The default value is dli. The value of DLI catalogs is dli.

Default value: dli

catalog_type

String

Data directory type. The default value is dil. The options include:

  • dli: DLI catalogs.
  • lakeformation: LakeFormation data directories.

Default value: dli

ds_project_id

String

ID of the project the DLI queue belongs to.

queue_name

String

SQL queue.

auth_type

String

Authentication mode. The value is AKSK.

Enumerated values:

  • AKSK

ds_ak

String

User AK. Mandatory when the authentication mode is AKSK.

ds_sk

String

User SK. Mandatory when the authentication mode is AKSK.

time_out

Integer

Request timeout interval when an API is used as the data source.

protocol

String

Protocol. The value is REST.

token_key

String

Token key.

token_value

String

Token value.

resp_param

Array of ResponseParamVO objects

Response parameters.

param_example

String

Parameter example for an API data source.

request_url

String

Request URL when an API is used as the data source.

request_method

String

Request method. The value can be GET or POST.

Enumerated values:

  • GET
  • POST

request_params

Array of RequestParamDto objects

List of request parameters.

Table 5 ResponseParamVO

Parameter

Type

Description

select

Boolean

Whether the current parameter is selected.

json_path

String

JSON path.

alias_name

String

Parameter alias.

field_type

String

Parameter type. The options include String, Long, Decimal, DateTime, and Bool.

param_name

String

Parameter name.

Table 6 RequestParamDto

Parameter

Type

Description

location

String

Location.

value

Array of strings

Parameter value.

tag_id

String

Tag ID. Mandatory when param_source is set to user.

param_name

String

Parameter name.

alias_name

String

Parameter alias.

field_type

String

Parameter type. The options include String, Long, Decimal, List<String>, List<Long>, List<Decimal>, DateTime, Bool, PageIndex, and PageNum.

param_source

String

Parameter source. The options include custom, user, and userGroup.

type

Boolean

Whether to encrypt data.

Example Request

Obtain data source details.

GET /v1/{project_id}/connections/{connection_id}

Example Response

Status code: 200

Data source details are successfully obtained.

{
  "id" : "xxxxxxx3796649a185b012a96xxxxxxx",
  "name" : "xxx_gaussdbtest",
  "host" : "xxx.xx.x.xx",
  "port" : 8000,
  "server_list" : "xxx.xx.x.xx:xxxx",
  "database_name" : "gaussdb",
  "user_name" : "modernbi",
  "test_url" : "jdbc:gaussdb://xxx.xx.xx.xx:xxxx/gaussdb?socketTimeout=120&loginTimeout=5&ssl=true",
  "project_id" : "xxxxxxxb4dac4055888643b33xxxxxxx",
  "domain_id" : "xxxxxxxf3c90428fb22606b64xxxxxxx",
  "work_space_id" : "xxxxxxxea0764ffa850664804xxxxxxx",
  "extra" : "[{\"ip\": \"xxx.xx.x.xx\", \"port\": xxxx, \"channelType\": \"eip\"}]",
  "config" : {
    "ssl" : true
  },
  "type" : "DWS",
  "source" : "dws",
  "mode" : "multi-node",
  "default_schema" : "public",
  "creation_user" : "xxxxxa863a94b0ba2887b80dxxxxx",
  "creation_date" : 1700114987113,
  "creation_user_name" : "test_name",
  "update_user" : "xxxxxxxa863a94b0ba2887b80dcxxxxxxx",
  "update_user_name" : "test_name",
  "update_date" : 1701071948929
}

Status Codes

Status Code

Description

200

Data source details are successfully obtained.

Error Codes

See Error Codes.