All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeReplicaSetRole

Last Updated:Mar 15, 2024

Queries the role and connection information of an ApsaraDB for MongoDB instance.

Operation description

This operation is applicable to replica set instances and standalone instances, but not to sharded cluster instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID.

dds-bpxxxxxxxx

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

DB4A0595-FCA9-437F-B2BB-25DBFC009D3E
DBInstanceIdstring

The instance ID.

dds-bpxxxxxxxx
ReplicaSetsobject []

The details of the roles of the replica set instance.

ConnectionPortstring

The port number that is used to connect to the node.

3717
ReplicaSetRolestring

The role of the node in the replica set instance. Valid values:

  • Primary
  • Secondary
Primary
ExpiredTimestring

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

1209582
ConnectionDomainstring

The endpoint of the node.

dds-bpxxxxxxxx.mongodb.rds.aliyuncs.com
NetworkTypestring

The network type of the instance. Valid values:

  • VPC: the virtual private cloud (VPC)
  • Classic: the classic network
  • Public: the Internet
VPC
RoleIdstring

The role ID of the node.

651xxxxx

Examples

Sample success responses

JSONformat

{
  "RequestId": "DB4A0595-FCA9-437F-B2BB-25DBFC009D3E",
  "DBInstanceId": "dds-bpxxxxxxxx",
  "ReplicaSets": {
    "ReplicaSet": [
      {
        "ConnectionPort": "3717",
        "ReplicaSetRole": "Primary",
        "ExpiredTime": "1209582",
        "ConnectionDomain": "dds-bpxxxxxxxx.mongodb.rds.aliyuncs.com",
        "NetworkType": "VPC",
        "RoleId": "651xxxxx"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError message
403ForbiddenUser not authorized to operate on the specified resource.

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

Change history

Change timeSummary of changesOperation
2023-05-18The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 403