Retrieves the connection information for a MongoDB sharded cluster instance.
Operation description
This operation applies only to sharded cluster instances.
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 the 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> |
A list of connection addresses for an instance that is compatible with the DynamoDB protocol. |
|
|
object |
|||
| VswitchId |
string |
The vSwitch ID in the VPC. Note
This parameter is returned when the network type is VPC. |
vsw-bpxxxxxxxx |
| ExpiredTime |
string |
The remaining validity period of the classic network endpoint. Unit: seconds. |
2591963 |
| NetworkType |
string |
The network type.
|
VPC |
| Port |
string |
The connection port. |
3717 |
| NetworkAddress |
string |
The endpoint. |
dds-bpxxxxxxxxxxxxxx.mongodb.rds.aliyuncs.com |
| VPCId |
string |
The VPC ID. Note
This parameter is returned when the network type is VPC. |
vpc-bpxxxxxxxx |
| IPAddress |
string |
The IP address. |
10.140.xxx.xx |
| RequestId |
string |
The request ID. |
18D8AAFD-6BEB-420F-8164-810CB0C0AA39 |
| NetworkAddresses |
object |
||
| NetworkAddress |
array<object> |
A list of connection addresses for an instance that is compatible with the MongoDB protocol. |
|
|
object |
|||
| NodeType |
string |
The node type. The return value is:
|
mongos |
| VswitchId |
string |
The vSwitch ID in the VPC. Note
This parameter is returned when the network type is VPC. |
vsw-bpxxxxxxxx |
| ExpiredTime |
string |
The remaining validity period of the classic network endpoint. Unit: seconds. |
2591963 |
| NetworkType |
string |
The network type.
|
VPC |
| Role |
string |
The node role. Valid values:
|
Primary |
| Port |
string |
The connection port. |
3717 |
| VPCId |
string |
The VPC ID. Note
This parameter is returned when the network type is VPC. |
vpc-bpxxxxxxxx |
| NetworkAddress |
string |
The endpoint. |
s-bpxxxxxxxx.mongodb.rds.aliyuncs.com |
| NodeId |
string |
The Mongos node ID. |
s-bpxxxxxxxx |
| IPAddress |
string |
The IP address. |
10.140.xxx.xx |
| ConnectionType |
string |
The type of the public endpoint. Valid values:
|
SRV |
| TxtRecord |
string |
The TXT record. This record stores MongoDB-related metadata, such as version information and configuration parameters. It can be used with other technologies, such as SRV records, to implement complex features like service discovery and configuration delivery. |
mongo.example.com. IN TXT "config=replicaSet=myReplicaSet" |
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\""
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.