You can call this operation to query the roles and zones of nodes in an ApsaraDB for MongoDB instance.

Note For more information, see View the zone of a node.

This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances.

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 Yes dds-bpxxxxxxxx

The ID of the instance.

Action String No DescribeRoleZoneInfo

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

AccessKeyId String No LTAIgbTGpxxxxxx

The AccessKey ID provided to you by Alibaba Cloud.

Response parameters

Parameter Type Example Description
RequestId String 728B9A96-E262-4AE5-915E-3A51CCE2FDA9

The ID of the request.

ZoneInfos

The distribution of nodes in the zone.

InsName String dds-bpxxxxxxxx

The ID of the node.

NodeType String normal

The type of the node. Valid values:

  • normal
  • configServer
  • shard
  • mongos
Note Valid value for replica set instances: normal. Valid values for replica set instances: configServer, shard, and mongos.
RoleId String 83xxxxx

The ID of the role.

RoleType String Primary

The role of the node. Valid values:

  • Primary
  • Secondary
  • Hidden
ZoneId String cn-hangzhou-e

The zone ID of the node.

Examples

Sample requests


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

Sample success responses

XML format

<DescribeRoleZoneInfoResponse>
	  <ZoneInfos>
		    <ZoneInfo>
			      <RoleType>Primary</RoleType>
			      <NodeType>normal</NodeType>
			      <InsName>dds-bpxxxxxxxx</InsName>
			      <ZoneId>cn-hangzhou-e</ZoneId>
			      <RoleId>83xxxxx</RoleId>
		    </ZoneInfo>
		    <ZoneInfo>
			      <RoleType>Secondary</RoleType>
			      <NodeType>normal</NodeType>
			      <InsName>dds-bpxxxxxxxx</InsName>
			      <ZoneId>cn-hangzhou-f</ZoneId>
			      <RoleId>83xxxxx</RoleId>
		    </ZoneInfo>
		    <ZoneInfo>
			      <RoleType>Hidden</RoleType>
			      <NodeType>normal</NodeType>
			      <InsName>dds-bpxxxxxxxx</InsName>
			      <ZoneId>cn-hangzhou-b</ZoneId>
			      <RoleId>83xxxxx</RoleId>
		    </ZoneInfo>
	  </ZoneInfos>
	  <RequestId>728B9A96-E262-4AE5-915E-3A51CCE2FDA9</RequestId>
</DescribeRoleZoneInfoResponse>

JSON format

{
	"ZoneInfos":{
		"ZoneInfo":[
			{
				"NodeType":"normal",
				"RoleType":"Primary",
				"InsName":"dds-bpxxxxxxxx",
				"ZoneId":"cn-hangzhou-e",
				"RoleId":"83xxxxx"
			},
			{
				"NodeType":"normal",
				"RoleType":"Secondary",
				"InsName":"dds-bpxxxxxxxx",
				"ZoneId":"cn-hangzhou-f",
				"RoleId":"83xxxxx"
			},
			{
				"NodeType":"normal",
				"RoleType":"Hidden",
				"InsName":"dds-bpxxxxxxxx",
				"ZoneId":"cn-hangzhou-b",
				"RoleId":"83xxxxx"
			}
		]
	},
	"RequestId":"728B9A96-E262-4AE5-915E-3A51CCE2FDA9"
}

Error codes

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