Retrieves the connection information for a MongoDB sharded cluster instance.
Operation description
This API is for sharded cluster instances only.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:DescribeShardingNetworkAddress |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
The instance ID. |
dds-bpxxxxxxxx |
| NodeId |
string |
No |
The ID of a mongos, shard, or ConfigServer node in the sharded cluster instance. Note
You can call the DescribeDBInstanceAttribute operation to query the IDs of mongos, shard, and ConfigServer nodes. |
d-bpxxxxxxxx |
| NetworkType |
string |
No |
The network type. Valid values:
|
VPC |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| CompatibleConnections |
object |
||
| CompatibleConnection |
array<object> |
Connection details for instances compatible with the DynamoDB protocol. |
|
|
object |
|||
| VswitchId |
string |
The ID of the vSwitch in the VPC. Note
This parameter is returned only when the network type is VPC. |
vsw-bpxxxxxxxx |
| ExpiredTime |
string |
The remaining validity period of the classic network address that is retained, in seconds. |
2591963 |
| NetworkType |
string |
The network type. Valid values:
|
VPC |
| Port |
string |
The port that is used to connect to the instance. |
3717 |
| NetworkAddress |
string |
The endpoint of the instance. |
dds-bpxxxxxxxxxxxxxx.mongodb.rds.aliyuncs.com |
| VPCId |
string |
The VPC ID. Note
This parameter is returned only when the network type is VPC. |
vpc-bpxxxxxxxx |
| IPAddress |
string |
The IP address of the instance. |
10.140.xxx.xx |
| RequestId |
string |
The request ID. |
18D8AAFD-6BEB-420F-8164-810CB0C0AA39 |
| NetworkAddresses |
object |
||
| NetworkAddress |
array<object> |
Connection details for instances that use the MongoDB protocol. |
|
|
object |
|||
| NodeType |
string |
The type of the node. Valid values:
|
mongos |
| VswitchId |
string |
The ID of the vSwitch in the VPC. Note
This parameter is returned only when the network type is VPC. |
vsw-bpxxxxxxxx |
| ExpiredTime |
string |
The remaining validity period of the classic network address that is retained, in seconds. |
2591963 |
| NetworkType |
string |
The network type. Valid values:
|
VPC |
| Role |
string |
The role of the node. Valid values:
|
Primary |
| Port |
string |
The port that is used to connect to the instance. |
3717 |
| VPCId |
string |
The VPC ID. Note
This parameter is returned only when the network type is VPC. |
vpc-bpxxxxxxxx |
| NetworkAddress |
string |
The endpoint of the node. |
s-bpxxxxxxxx.mongodb.rds.aliyuncs.com |
| NodeId |
string |
The ID of the mongos or shard node. |
s-bpxxxxxxxx |
| IPAddress |
string |
The IP address of the node. |
10.140.xxx.xx |
| ConnectionType |
string |
The type of the public endpoint. Valid values:
|
SRV |
| TxtRecord |
string |
The TXT record. A TXT record is a type of Domain Name System (DNS) record that is used to store text-based information about a domain. It can be used to deliver service configurations and discover services by working with other technologies such as SRV records. |
mongo.example.com. IN TXT "config=replicaSet=myReplicaSet" |
| ConnectionStringSuffix |
string |
The suffix of the connection string. |
.mongodb.rds.aliyuncs.com |
Examples
Success response
JSON format
{
"CompatibleConnections": {
"CompatibleConnection": [
{
"VswitchId": "vsw-bpxxxxxxxx",
"ExpiredTime": "2591963",
"NetworkType": "VPC",
"Port": "3717",
"NetworkAddress": "dds-bpxxxxxxxxxxxxxx.mongodb.rds.aliyuncs.com",
"VPCId": "vpc-bpxxxxxxxx",
"IPAddress": "10.140.xxx.xx"
}
]
},
"RequestId": "18D8AAFD-6BEB-420F-8164-810CB0C0AA39",
"NetworkAddresses": {
"NetworkAddress": [
{
"NodeType": "mongos",
"VswitchId": "vsw-bpxxxxxxxx",
"ExpiredTime": "2591963",
"NetworkType": "VPC",
"Role": "Primary",
"Port": "3717",
"VPCId": "vpc-bpxxxxxxxx",
"NetworkAddress": "s-bpxxxxxxxx.mongodb.rds.aliyuncs.com",
"NodeId": "s-bpxxxxxxxx",
"IPAddress": "10.140.xxx.xx",
"ConnectionType": "SRV",
"TxtRecord": "mongo.example.com. IN TXT \"config=replicaSet=myReplicaSet\""
}
]
},
"ConnectionStringSuffix": ".mongodb.rds.aliyuncs.com"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.