Creates a DBLink.
Operation description
A DBLink provides connectivity between two PolarDB for PostgreSQL (Oracle-compatible) clusters, or between a PolarDB for PostgreSQL (Oracle-compatible) cluster and a self-managed PostgreSQL database on an Elastic Compute Service (ECS) instance. This lets you query data across clusters.
Each cluster supports a maximum of 10 DBLinks.
A DBLink consumes one DBLink quota from both the source cluster and the destination cluster.
The source cluster and the destination cluster or destination ECS instance must be in the same region.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:CreateDBLink |
create |
*DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-************ |
| DBClusterId |
string |
Yes |
The ID of the source cluster for the DBLink. Note
You can call the DescribeDBClusters operation to query the list of PolarDB clusters. |
pc-a************ |
| DBLinkName |
string |
Yes |
The name of the DBLink.
|
dblink_test |
| TargetDBInstanceName |
string |
No |
The ID of the destination cluster for the DBLink. Note
|
pc-b************ |
| TargetDBAccount |
string |
Yes |
The account of the destination database. Note
You can call the DescribeAccounts operation to query the database accounts of a PolarDB cluster. |
testacc |
| TargetDBPasswd |
string |
Yes |
The password for the destination database account. |
Test1111 |
| TargetDBName |
string |
Yes |
The name of the destination database. Note
You can call the DescribeDatabases operation to query information about databases in a PolarDB cluster. |
testdb2 |
| SourceDBName |
string |
Yes |
The name of the source database. Note
You can call the DescribeDatabases operation to query information about databases in a PolarDB cluster. |
testdb1 |
| TargetIp |
string |
No |
The IP address of the self-managed Oracle database that runs on an ECS instance. |
192.**.**.46 |
| TargetPort |
string |
No |
The port number of the self-managed Oracle database that runs on an ECS instance. |
1521 |
| VpcId |
string |
No |
The ID of the virtual private cloud (VPC). Note
You can call the DescribeVpcs operation to query the details of VPCs. |
vpc-bp1qpo0kug3a20qqe**** |
| RegionId |
string |
No |
The region ID. Note
You can call the DescribeRegions operation to query the details of regions. |
cn-hangzhou |
| ClientToken |
string |
No |
A client token that is used to ensure the idempotence of the request. The client generates the token, but you must make sure that the token is unique among different requests. The token is case-sensitive and must not exceed 64 ASCII characters in length. |
6000170000591aed949d0f54a343f1a4233c1e7d1c5c****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
F9F1CB1A-B1D5-4EF5-A53A-************ |
Examples
Success response
JSON format
{
"RequestId": "F9F1CB1A-B1D5-4EF5-A53A-************"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDBLinkName.Malformed | The specified parameter DBLinkName is not valid. | The specified DBLinkName parameter is invalid. |
| 404 | InvalidDBClusterId.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
| 404 | DBLinkSourceDBNotFound | Specified source db does not exist. | The specified source database does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.