You can call this operation to query the connection information of sharded cluster instances in ApsaraDB for MongoDB.

This operation supports sharded cluster instances only.

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

Parameter Type Required Example Description
DBInstanceId String No dds-bpxxxxxxxx

The ID of the instance.

Action String Yes DescribeShardingNetworkAddress

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

NodeId String Yes d-bpxxxxxxxx

The ID of the Mongos, Shard, or config server in the specified sharded cluster instance.

Note You can call DescribeDBInstanceAttribute to query the IDs of Mongos, Shard, and ConfigServer nodes.
AccessKeyId String Yes LTAIgbTGpxxxxxx

The AccessKey ID that Alibaba Cloud provides for you to access services.

Response parameters

Parameter Type Example Description
NetworkAddresses Array

The list of the instance connection addresses.

NetworkAddress

The list of the instance connection addresses.

ExpiredTime String 2591963

The remaining duration of the classic network address. Unit: seconds.

IPAddress String 10.140.xxx.xx

The IP address of the instance.

NetworkAddress String s-bpxxxxxxxx.mongodb.rds.aliyuncs.com

The connection address (string).

NetworkType String VPC

The network type. Valid values:

  • VPC
  • Classic
  • Public
NodeId String s-bpxxxxxxxx

The ID of the mongos.

NodeType String mongos

The type of the node. Valid values:

  • mongos: mongos node.
  • shard: shard node.
  • configserver: configserver node.
Port String 3717

The port number.

Role String Primary

The role of the node. Valid values:

  • Primary
  • Secondary
VPCId String vpc-bpxxxxxxxx

The ID of the VPC.

Note When the network type is VPC this parameter is returned when the API is called.
VswitchId String vsw-bpxxxxxxxx

The VSwitch ID of the VPC.

Note This parameter is returned when the network type is VPC.
RequestId String 18D8AAFD-6BEB-420F-8164-810CB0C0AA39

The ID of the request.

Examples

Sample requests


http(s)://mongodb.aliyuncs.com/? Action=DescribeShardingNetworkAddress
&DBInstanceId=dds-bpxxxxxxxx
&<Common request parameters>

Successful response examples

XML format

<NetworkAddresses>
    <NetworkAddress>
        <NetworkType>Public</NetworkType>
        <NodeId>s-bpxxxxxxxx</NodeId>
        <Port>3717</Port>
        <VPCId/>
        <IPAddress>47.xx.xx.xxx</IPAddress>
        <NodeType>mongos</NodeType>
        <Role>Primary</Role>
        <NetworkAddress>s-bpxxxxxxxx-pub.mongodb.rds.aliyuncs.com</NetworkAddress>
    </NetworkAddress>
    <NetworkAddress>
        <NetworkType>VPC</NetworkType>
        <NodeId>s-bpxxxxxxxx</NodeId>
        <Port>3717</Port>
        <VPCId>vpc-bpxxxxxxxx</VPCId>
        <IPAddress>192.168.xx.xxx</IPAddress>
        <NodeType>mongos</NodeType>
        <Role>Primary</Role>
        <VswitchId>vsw-bpxxxxxxxx</VswitchId>
        <NetworkAddress>s-bpxxxxxxxx.mongodb.rds.aliyuncs.com</NetworkAddress>
    </NetworkAddress>
</NetworkAddresses>
<RequestId>3F5DD5CD-0B93-46FF-96DD-F938B13CDE8B</RequestId>

JSON format

{
	"NetworkAddresses":{
		"NetworkAddress":[
			{
				"NetworkType":"Public",
				"Port":"3717",
				"NodeId":"s-bpxxxxxxxx",
				"VPCId":"",
				"IPAddress":"47.xx.xx.xxx",
				"NodeType":"mongos",
				"NetworkAddress":"s-bpxxxxxxxx-pub.mongodb.rds.aliyuncs.com",
				"Role":"Primary"
			},
			{
				"NetworkType":"VPC",
				"Port":"3717",
				"NodeId":"s-bpxxxxxxxx",
				"VPCId":"vpc-bpxxxxxxxx",
				"IPAddress":"192.168.xx.xxx",
				"NodeType":"mongos",
				"NetworkAddress":"s-bpxxxxxxxx.mongodb.rds.aliyuncs.com",
				"VswitchId":"vsw-bpxxxxxxxx",
				"Role":"Primary"
			}
		]
	},
	"RequestId":"3F5DD5CD-0B93-46FF-96DD-F938B13CDE8B"
}

Error codes

For a list of error codes, visit API Error Center.