Updated on 2024-12-10 GMT+08:00

Querying the Data Connection List

Function

This API is used to query the data connection list.

Debugging

You can debug this API in API Explorer. Automatic authentication is supported. API Explorer can automatically generate sample SDK code and provide the sample SDK code debugging.

URI

GET /v2/{project_id}/data-connectors

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation

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

Constraints

N/A

Value range

The value must consist of 1 to 64 characters. Only letters and digits are allowed.

Default value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

connector_id

No

String

Explanation

Connection ID.

Constraints

N/A

Value range

The value can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-).

Default value

N/A

source_type

No

String

Explanation

Data source type.

Constraints

N/A

Value range

  • RDS_POSTGRES: RDS PostgreSQL database
  • RDS_MYSQL: RDS MySQL database
  • gaussdb-mysql: GaussDB(for MySQL)

Default value

N/A

connector_name

No

String

Explanation

Data connection name.

Constraints

N/A

Value range

N/A

Default value

N/A

limit

No

Integer

Explanation

Number of resources on each page.

Constraints

N/A

Value range

1-1000

Default value

N/A

offset

No

Integer

Explanation

Start offset of the pagination query.

Constraints

N/A

Value range

≥0

Default value

N/A

available

No

Boolean

Explanation

Whether the data connection is valid.

Constraints

N/A

Value range

true: The connection is valid.

false: The connection is invalid.

Default value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total_count

Integer

Explanation

Total number of data connections

Constraints

N/A

Value range

N/A

Default value

N/A

data_connectors

Array of DataConnectorDetail objects

Explanation

Data connection details list. For details, see Table 4.

Constraints

N/A

Value range

N/A

Default value

N/A

Table 4 DataConnectorDetail

Parameter

Type

Description

connector_name

String

Explanation

Data connection name.

Constraints

N/A

Value range

N/A

Default value

N/A

source_type

String

Explanation

Data connection type.

Constraints

N/A

Value range

  • RDS_POSTGRES: RDS PostgreSQL database
  • RDS_MYSQL: RDS MySQL database
  • gaussdb-mysql: GaussDB(for MySQL)

Default value

N/A

source_info

String

Explanation

Data source information, which is in JSON format.

Constraints

N/A

Value range

N/A

Default value

N/A

connector_id

String

Explanation

Data connection ID.

Constraints

N/A

Value range

N/A

Default value

N/A

create_time

Long

Explanation

Time when the connection is created.

Constraints

N/A

Value range

N/A

Default value

N/A

last_update_time

Long

Explanation

Last update time of the connection.

Constraints

N/A

Value range

N/A

Default value

N/A

create_by

String

Explanation

Creator ID.

Constraints

N/A

Value range

N/A

Default value

N/A

create_user

String

Explanation

Creator username.

Constraints

N/A

Value range

N/A

Default value

N/A

tenant_id

String

Explanation

Tenant ID.

Constraints

N/A

Value range

N/A

Default value

N/A

last_update_by

String

Explanation

ID of the user who last updated the information.

Constraints

N/A

Value range

N/A

Default value

N/A

status

Integer

Explanation

Data connection status.

Constraints

N/A

Value range

  • -1: deleted
  • 0: normal
  • -2: abnormal
  • 1: in use

Default value

N/A

used_clusters

String

Explanation

Clusters using the connection.

Constraints

N/A

Value range

N/A

Default value

N/A

encrypt_type

Integer

Explanation

Encryption type

Constraints

N/A

Value range

N/A

Default value

N/A

Example Request

None

Example Response

Status code: 200

Successful query of the data connection list

{
  "total_count" : 1,
  "data_connectors" : [ {
    "connector_id" : "7d169c6c-ab50-4a56-a5d2-240ca20aabda",
    "connector_name" : "test",
    "create_time" : 1681270961,
    "source_type" : "RDS_MYSQL",
    "source_info" : "{\"rds_instance_id\":\"3ce1ae8af8cd43b2bcbd18b7541bb8b0in01\",\"jdbc_url\":\"jdbc:mysql://192.XXX.XXX.XXX:3306/test?socketTimeout=60000\",\"db_name\":\"test\",\"user_name\":\"root\",\"driver_path\":\"mrs-public/dirvers/mysql-connector-java-5.1.47.jar\"}",
    "last_update_time" : 1681270961,
    "create_by" : "148c89d603e048b291f5940935b38f46",
    "create_user" : "xxx",
    "tenant_id" : "xxxxe662a7e24cc99bfc858c4558dbf6",
    "last_update_by" : "148c89d603e048b291f5940935b38f46",
    "status" : 0,
    "encrypt_type" : 2
  } ]
}

Status Codes

See Status Codes.

Error Codes

See Error Codes.