You can call this operation to query the information of the database account of a MongoDB instance.

Note This operation can query only the information of the root account.

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
Action String No DescribeAccounts

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

DBInstanceId String Yes dds-bpxxxxxxxx

The ID of the instance.

RegionId String No cn-hangzhou

The ID of the region where the specified instance is located. You can call the DescribeRegions operation to query the latest regions.

AccountName String No root

The name of the account. Valid values:root.

Response parameters

Parameter Type Example Description
RequestId String B562A65B-39AB-4EE8-8635-5A222054FB35

The ID of the request.

Accounts Array

The detailed list of database accounts.

DBInstanceId String dds-bpxxxxxxxx

The name of the instance to which the account belongs.

AccountName String root

The name of the account that you want to manage.

AccountStatus String Available

The status of the account.

  • Unavailable
  • Available
AccountDescription String Administrator

The description of the account.

CharacterType String 11111111

The type of the account. Return values:

  • mongos: The logon account of the mongos.
  • Shard: The account used to log on to the shard.

Examples

Sample requests

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

Sample success responses

XML format

<DescribeAccountsResponse>
      <Accounts>
            <Account>
                  <AccountStatus>Available</AccountStatus>
                  <AccountDescription>Administrator</AccountDescription>
                  <DBInstanceId>dds-bpxxxxxxxx</DBInstanceId>
                  <AccountName>root</AccountName>
            </Account>
      </Accounts>
      <RequestId>A806B0FC-CFCC-48D8-8AEC-34C892806B40</RequestId>
</DescribeAccountsResponse>

JSON format

{
    "Accounts": {
        "Account": [
            {
                "AccountStatus": "Available",
                "AccountDescription": "administrator",
                "DBInstanceId": "dds-bpxxxxxxxx",
                "AccountName": "root"
            }
        ]
    },
    "RequestId": "A806B0FC-CFCC-48D8-8AEC-34C892806B40"
}

Error codes

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