Queries the database links of a PolarDB for PostgreSQL(Compatible with Oracle) cluster.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | No | DescribeDBLinks | The operation that you want to perform. Set the value to DescribeDBLinks. |
| DBClusterId | String | Yes | pc-a************* | The ID of the cluster for which you want to query the database links. |
| DBLinkName | String | No | dblink_test | The name of the database link. If you leave this parameter empty, the system returns all the database links. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| DBInstanceName | String | pc-a************* | The ID of the cluster. |
| DBLinkInfos | Array of DBLinkInfos | The information set of the database link. | |
| DBInstanceName | String | pc-a************* | The ID of the source cluster that the database link connects. |
| DBLinkName | String | dblink_test | The name of the database link. |
| SourceDBName | String | testdb1 | The name of the source database of the database link. |
| TargetAccount | String | testacc | The account of the destination database of the database link. |
| TargetDBInstanceName | String | pc-b************ | The ID of the destination cluster that the database link connects. Note If the destination cluster is not a PolarDB for PostgreSQL(Compatible with Oracle) cluster, the returned value is empty. |
| TargetDBName | String | testdb2 | The name of the destination database of the database link. |
| RequestId | String | 45D24263-7E3A-4140-9472-************ | The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/? Action=DescribeDBLinks
&DBClusterId=pc-*************
&<Common request parameters>Sample success responses
XML format
<DescribeDBLinksResponse>
<RequestId>45D24263-7E3A-4140-9472-7C1BE3B1F19A</RequestId>
<DBLinkInfos>
<SourceDBName>testdb1</SourceDBName>
<TargetDBName>testdb2</TargetDBName>
<TargetAccount>testacc</TargetAccount>
<TargetDBInstanceName>pc-b************</TargetDBInstanceName>
<DBInstanceName>pc-a*************</DBInstanceName>
<DBLinkName>dblink_test</DBLinkName>
</DBLinkInfos>
</DescribeDBLinksResponse>JSON format
{
"RequestId": "45D24263-7E3A-4140-9472-7C1BE3B1F19A",
"DBLinkInfos": [
{
"SourceDBName": "testdb1",
"TargetDBName": "testdb2",
"TargetAccount": "testacc",
"TargetDBInstanceName": "pc-b************",
"DBInstanceName": "pc-a*************",
"DBLinkName": "dblink_test"
}
]
}Error codes
For a list of error codes, visit the API Error Center.