Querying an Enhanced Datasource Connection List
Function
This API is used to query the list of created enhanced datasource connections.
Debugging
You can debug this API in API Explorer.
URI
- URI format
- Parameter description
Table 1 URI parameter Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.
Table 2 query parameter description Parameter
Mandatory
Type
Description
limit
No
String
The maximum number of connections to be queried. The default value is 100. If limit is set to 0, all datasource connections are returned.
offset
No
String
The offset of the query result. The default value is 0. Note that the connections are sorted by creation time.
status
No
String
Connection status. The options are as follows:
- Active: The connection has been activated.
- DELETED: The connection has been deleted.
NOTE:The connection status is case insensitive.
name
No
String
Connection name
tags
No
String
List of tag names. The value is k=v for a single tag. Multiple tags are separated by commas (,). Example: tag1=v1,tag2=v2.
The following is an example of the URL containing the query parameter:
GET /v2.0/{project_id}/datasource/enhanced-connections?limit={limit}&offset={offset}&status={status}&name={name}
Request
None
Response
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| is_success | No | Boolean | Indicates whether the request is successfully executed. Value true indicates that the request is successfully executed. |
| message | No | String | System prompt. If execution succeeds, the parameter setting may be left blank. |
| connections | No | Array of Objects | Datasource connection information list. For details, see Table 4. |
| count | No | Integer | Number of returned datasource connections. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Connection ID. Identifies the UUID of a datasource connection. |
| name | No | String | User-defined connection name. |
| status | No | String | Connection status. The options are as follows:
|
| available_queue_info | No | Array of Objects | For details about how to create a datasource connection for each queue, see Table 5. |
| dest_vpc_id | No | String | The VPC ID of the connected service. For details, see Querying VPC Details in Virtual Private Cloud API Reference. |
| dest_network_id | No | String | Subnet ID of the connected service. For details, see Querying Subnet Details in Virtual Private Cloud API Reference. |
| create_time | No | Long | Time when a link is created. The time is converted to a UTC timestamp. |
| hosts | No | Array of Objects | User-defined host information. For details, see Table 4. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| peer_id | No | String | ID of a datasource connection. |
| status | No | String | Connection status. For details about the status code, see Table 6. |
| name | No | String | Name of a queue. |
| err_msg | No | String | Detailed error message when the status is FAILED. |
| update_time | No | Long | Time when the available queue list was updated. |
Example
- Example request
None
- Example response (successful request)
{ "is_success": true, "message": "", "count": 1, "connections": [ { "name": "withvpc", "id": "4c693ecc-bab8-4113-a838-129cedc9a563", "available_queue_info": [ { "status": "ACTIVE", "name": "resource_mode_1", "peer_id": "d2ae6628-fa37-4e04-806d-c59c497492d1", "err_msg": "", "update_time": 1566889577861 } ], "dest_vpc_id": "22094d8f-c310-4621-913d-4c4d655d8495", "dest_network_id": "78f2562a-36e4-4b39-95b9-f5aab22e1281", "create_time": 1566888011125, "status": "ACTIVE" } ] }
Status Codes
Table 7 describes the status code.
Error Codes
If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Code.
Last Article: Deleting an Enhanced Datasource Connection
Next Article: Querying an Enhanced Datasource Connection
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.