All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeShardingNetworkAddress

Last Updated:Dec 25, 2025

Queries the connection information for a MongoDB sharded cluster instance.

Operation description

This operation is applicable only to sharded cluster instances.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dds:DescribeShardingNetworkAddress

get

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

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

Call the DescribeDBInstanceAttribute operation to query the IDs of Mongos, shard, and ConfigServer nodes.

d-bpxxxxxxxx

Response elements

Element

Type

Description

Example

object

CompatibleConnections

object

CompatibleConnection

array<object>

A list of connection information for an instance that is compatible with the DynamoDB protocol.

object

VswitchId

string

The ID of the vSwitch 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 address, in seconds.

2591963

NetworkType

string

The network type.

  • VPC: virtual private cloud.

  • Classic: classic network.

  • Public: public network.

VPC

Port

string

The connection port.

3717

NetworkAddress

string

The connection address.

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 information for an instance that is compatible with the MongoDB protocol.

object

NodeType

string

The node type. Valid values:

  • mongos: a Mongos node.

  • shard: a shard node.

  • configserver: a ConfigServer node.

mongos

VswitchId

string

The ID of the vSwitch 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 address, in seconds.

2591963

NetworkType

string

The network type.

  • VPC: virtual private cloud.

  • Classic: classic network.

  • Public: public network.

VPC

Role

string

The role of the node. Valid values:

  • Primary: the primary node.

  • Secondary: a secondary node.

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 connection address.

s-bpxxxxxxxx.mongodb.rds.aliyuncs.com

NodeId

string

The ID of the Mongos node.

s-bpxxxxxxxx

IPAddress

string

The IP address.

10.140.xxx.xx

ConnectionType

string

The type of the public endpoint. Valid values:

  • SRV

  • Normal

SRV

TxtRecord

string

The TXT record that stores MongoDB metadata, such as version information and configuration parameters. This record works with other technologies, such as SRV records, to enable 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.