All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeShardingNetworkAddress

Last Updated:Nov 06, 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.

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

debugging

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • 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 Key: the condition key that is defined by the cloud service.
  • 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.
OperationAccess levelResource typeCondition keyAssociated operation
dds:DescribeShardingNetworkAddressREAD
  • DBInstance
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of an instance.

dds-bpxxxxxxxx
NodeIdstringNo

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

ParameterTypeDescriptionExample
object
CompatibleConnectionsobject []

An array that consists of the endpoints of DynamoDB instances.

VswitchIdstring

The vSwitch ID of the VPC.

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

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

2591963
NetworkTypestring

The network type. Valid values:

  • VPC
  • Classic
  • Public: pubic endpoint
VPC
Portstring

The port number.

3717
NetworkAddressstring

The endpoint of the instance.

dds-bpxxxxxxxxxxxxxx.mongodb.rds.aliyuncs.com
VPCIdstring

The ID of the VPC.

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

The IP address of the instance.

10.140.xxx.xx
RequestIdstring

The ID of the request.

18D8AAFD-6BEB-420F-8164-810CB0C0AA39
NetworkAddressesobject []

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

NodeTypestring

The type of the node. Valid values:

  • mongos
  • shard
  • configserver
mongos
VswitchIdstring

The vSwitch ID of the VPC.

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

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

2591963
NetworkTypestring

The network type. Valid values:

  • VPC
  • Classic
  • Public: pubic endpoint
VPC
Rolestring

The role of the node. Valid values:

  • Primary
  • Secondary
Primary
Portstring

The port number.

3717
VPCIdstring

The ID of the VPC.

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

The endpoint of the instance.

s-bpxxxxxxxx.mongodb.rds.aliyuncs.com
NodeIdstring

The ID of the mongos.

s-bpxxxxxxxx
IPAddressstring

The IP address of the instance.

10.140.xxx.xx

Examples

Sample success responses

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 Service error codes.