All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeShardingNetworkAddress

Last Updated:Nov 05, 2024

Queries connection information about an ApsaraDB for MongoDB sharded cluster instance.

Operation description

This operation is applicable only to sharded cluster instances.

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.

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:DescribeShardingNetworkAddressget
  • Instance
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID.

dds-bpxxxxxxxx
NodeIdstringNo

The ID of the mongos, shard, or Configserver node in the sharded cluster instance.

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

Response parameters

ParameterTypeDescriptionExample
object
CompatibleConnectionsarray<object>

The endpoints of DynamoDB-compatible instances.

CompatibleConnectionobject
VswitchIdstring

The ID of the vSwitch in the Virtual Private Cloud (VPC).

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

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

2591963
NetworkTypestring

The network type of the instance.

  • VPC: virtual private cloud
  • Classic: classic network
  • Public: the Internet
VPC
Portstring

The port that is used to connect to the instance.

3717
NetworkAddressstring

The endpoint of the instance.

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

The VPC ID of the instance.

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 request ID.

18D8AAFD-6BEB-420F-8164-810CB0C0AA39
NetworkAddressesarray<object>

The endpoints of the ApsaraDB for MongoDB sharded cluster instance.

NetworkAddressobject
NodeTypestring

The type of the node. Valid values:

  • mongos: mongos node
  • shard: shard node
  • configserver: Configserver node
mongos
VswitchIdstring

The ID of the vSwitch in the VPC.

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

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

2591963
NetworkTypestring

The network type of the instance.

  • VPC: virtual private cloud
  • Classic: classic network
  • Public: the Internet
VPC
Rolestring

The role of the node. Valid values:

  • Primary
  • Secondary
Primary
Portstring

The port that is used to connect to the instance.

3717
VPCIdstring

The VPC ID of the instance.

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

The connection string of the instance.

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

The ID of the mongos node.

s-bpxxxxxxxx
IPAddressstring

The IP address of the instance.

10.140.xxx.xx
ConnectionTypestring

The public endpoint type. Valid values:

  • SRV
  • Normal
SRV
TxtRecordstring

Txt record which can be used to store MongoDB-related meta data, such as version, configuration parameters and etc. With the combination of txt record and other technology, for example SRV record, the MongoDB client can complete the complex service discovery and configuration passing.

mongo.example.com. IN TXT "config=replicaSet=myReplicaSet"

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",
        "ConnectionType": "SRV",
        "TxtRecord": "mongo.example.com. IN TXT \"config=replicaSet=myReplicaSet\""
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-10-22The response structure of the API has changedView Change Details