All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeShardingNetworkAddress

Last Updated:Jan 17, 2023

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

Operation Description

This operation supports sharded cluster instances only.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All resources is used in the Resource type column of the operation.
  • Condition keyword: refers to the condition keyword defined by the cloud product itself.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operate access level Resource type conditional keyword Association operation
dds:DescribeShardingNetworkAddress READ
  • MongoDB
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId}
    without
without

Request parameters

Parameter Type Required Description Example
DBInstanceId string Yes

The ID of an instance.

dds-bpxxxxxxxx
NodeId string No

A sharded cluster instance consists of three components: mongos, shard, and Configserver.

Note You can call the DescribeDBInstanceAttribute operation to query the ID of the mongos, shard, or Configserverr node.
d-bpxxxxxxxx

Response parameters

Parameter Type Description Example
object
CompatibleConnections array

An array that consists of the endpoints of DynamoDB instances.

object
VswitchId string

The vSwitch ID of the VPC.

Note This parameter is returned when the network type is VPC.
vsw-bpxxxxxxxx
ExpiredTime string

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

2591963
NetworkType string

The network type. Valid values:

  • VPC
  • Classic
  • Public: pubic endpoint
VPC
Port string

The port number.

3717
NetworkAddress string

The endpoint of the instance.

dds-bpxxxxxxxxxxxxxx.mongodb.rds.aliyuncs.com
VPCId string

The ID of the VPC.

Note This parameter is returned when the network type is VPC.
vpc-bpxxxxxxxx
IPAddress string

The IP address of the instance.

10.140.xxx.xx
RequestId string

The ID of the request.

18D8AAFD-6BEB-420F-8164-810CB0C0AA39
NetworkAddresses array

An array that consists of the endpoints of ApsaraDB for MongoDB instances.

object
NodeType string

The type of the node. Valid values:

  • mongos
  • shard
  • configserver
mongos
VswitchId string

The vSwitch ID of the VPC.

Note This parameter is returned when the network type is VPC.
vsw-bpxxxxxxxx
ExpiredTime string

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

2591963
NetworkType string

The network type. Valid values:

  • VPC
  • Classic
  • Public: pubic endpoint
VPC
Role string

The role of the node. Valid values:

  • Primary
  • Secondary
Primary
Port string

The port number.

3717
VPCId string

The ID of the VPC.

Note This parameter is returned when the network type is VPC.
vpc-bpxxxxxxxx
NetworkAddress string

The endpoint of the instance.

s-bpxxxxxxxx.mongodb.rds.aliyuncs.com
NodeId string

The ID of the mongos.

s-bpxxxxxxxx
IPAddress string

The IP address of the instance.

10.140.xxx.xx

Example

Normal return example

JSONFormat

{
  "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"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the API error center.