Queries the database links of a PolarDB for PostgreSQL(Compatible with Oracle) cluster.

Note You can query only the database links that use a PolarDB for PostgreSQL(Compatible with Oracle) cluster as the source cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringNoDescribeDBLinks

The operation that you want to perform. Set the value to DescribeDBLinks.

DBClusterIdStringYespc-a*************

The ID of the cluster for which you want to query the database links.

Note You can call the DescribeDBClusters operation to query PolarDB clusters.
DBLinkNameStringNodblink_test

The name of the database link. If you leave this parameter empty, the system returns all the database links.

Response parameters

ParameterTypeExampleDescription
DBInstanceNameStringpc-a*************

The ID of the cluster.

DBLinkInfosArray of DBLinkInfos

The information set of the database link.

DBInstanceNameStringpc-a*************

The ID of the source cluster that the database link connects.

DBLinkNameStringdblink_test

The name of the database link.

SourceDBNameStringtestdb1

The name of the source database of the database link.

TargetAccountStringtestacc

The account of the destination database of the database link.

TargetDBInstanceNameStringpc-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.
TargetDBNameStringtestdb2

The name of the destination database of the database link.

RequestIdString45D24263-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.