All Products
Search
Document Center

ApsaraDB RDS:DescribeAccounts

Last Updated:May 29, 2023

Queries the details of accounts that are created on an instance.

Operation Description

NoteThis operation is not supported for instances that run SQL Server 2017 on RDS Cluster Edition.

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
rds:DescribeAccountsREAD
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

NoteThis operation is not supported for instances that run SQL Server 2017 on RDS Cluster Edition.
rm-uf6wjk5*****
AccountNamestringNo

The username of the account.

test1
PageSizeintegerNo

The number of entries per page. Valid value: 30 to 200. Default value: 30.

30
PageNumberintegerNo

The page number. Default value: 1. Valid values: any non-zero positive integer.

1

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

SystemAdminAccountStatusstring

Indicates whether the superuser account is enabled.

True
SystemAdminAccountFirstActivationTimestring

The first time when the superuser account was enabled. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2020-02-06T11:00:00Z
PageNumberinteger

The page number.

1
RequestIdstring

The ID of the request.

A2E94301-D07F-4457-9B49-6AA2BB388C85
TotalRecordCountinteger

The total number of entries returned.

1
Accountsobject []

The details of the accounts.

AccountStatusstring

The status of the account. Valid values:

  • Unavailable
  • Available
Available
AccountDescriptionstring

The description of the account.

Test account
DBInstanceIdstring

The ID of the instance to which the account belongs.

rm-uf6wjk5*****
PrivExceededstring

Indicates whether the number of databases that are managed by the account exceeds the upper limit. Valid values:

  • 1: yes
  • 0: no
0
AccountTypestring

The type of the account. Valid values:

  • Normal: standard account
  • Super: privileged account
  • Sysadmin: superuser account that has the system administrator permissions
Normal
AccountNamestring

The username of the account.

test1
DatabasePrivilegesobject []

The details of the permissions that are granted to the account.

DBNamestring

The name of the database.

test1
AccountPrivilegestring

The type of the permissions. Valid values:

  • ReadWrite: read and write permissions
  • ReadOnly: read-only permissions
  • DDLOnly: DDL-only permissions
  • DMLOnly: DML-only permissions
  • Custom: custom permissions (You can modify the permissions of the account by using SQL commands.)
ReadWrite
AccountPrivilegeDetailstring

The permissions that are granted to the account. For more information, see Account permissions.

SELECT,INSERT
ValidUntilstring

The expiration time of the password. Valid values:

  • infinity: The password never expires.
  • Empty: The expiration time is not specified.
  • Actual expiration time in the format of yyyy-MM-ddTHH:mm:ssZ in UTC. Example: 2022-10-01T00:00:00Z.
NoteThis parameter is returned only for instances that run PostgreSQL.
2022-10-01T00:00:00Z
CreateDBstring

Indicates whether the account has the permissions to create databases. Valid values:

  • t: yes
  • f: no
NoteThis parameter is returned only for instances that run PostgreSQL.
t
Replicationstring

Indicates whether the account has the replication permissions. Valid values:

  • t: yes
  • f: no
NoteThis parameter is returned only for instances that run PostgreSQL.
t
CreateRolestring

Indicates whether the account has the permissions to create roles. Valid values:

  • t: yes
  • f: no
NoteThis parameter is returned only for instances that run PostgreSQL.
t
BypassRLSstring

Indicates whether the account has the row-level security (RLS) permissions. Valid values:

  • t: yes
  • f: no
NoteThis parameter is returned only for instances that run PostgreSQL.
f

Examples

Sample success responses

JSONformat

{
  "SystemAdminAccountStatus": "True",
  "SystemAdminAccountFirstActivationTime": "2020-02-06T11:00:00Z",
  "PageNumber": 1,
  "RequestId": "A2E94301-D07F-4457-9B49-6AA2BB388C85",
  "TotalRecordCount": 1,
  "Accounts": {
    "DBInstanceAccount": [
      {
        "AccountStatus": "Available",
        "AccountDescription": "Test account\n",
        "DBInstanceId": "rm-uf6wjk5*****",
        "PrivExceeded": "0",
        "AccountType": "Normal",
        "AccountName": "test1",
        "DatabasePrivileges": {
          "DatabasePrivilege": [
            {
              "DBName": "test1",
              "AccountPrivilege": "ReadWrite",
              "AccountPrivilegeDetail": "SELECT,INSERT"
            }
          ]
        },
        "ValidUntil": "2022-10-01T00:00:00Z",
        "CreateDB": "t",
        "Replication": "t",
        "CreateRole": "t",
        "BypassRLS": "f"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400IO.ExceptionIO exception, retry later.An I/O error occurred.
400Database.ConnectErrorDatabase connect error. please check instance status and database processlistA database connection error occurred. Check the instance state and the database connection pool.
400InvalidDBInstanceStatus.NotSupportThe Specified instance status is not supported to query account list.-
400InvalidEngine.MalformedSpecified engine is not valid.The database engine is invalid. Specify a valid database engine.
400Account.QueryErrorQuery Account failed, please check your input value.Failed to query the account. Check the specified parameters.
403IncorrectDBInstanceStateCurrent DB instance state does not support this operation.-
404InvalidDBInstanceName.NotFoundThe database instance does not exist.The name of the RDS instance cannot be found. Check the name of the RDS instance.
404IncorrectDBInstanceLockModeCurrent DB instance lock mode does not support this operation.The operation failed. The RDS instance is locked.

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

Change history

Change timeSummary of changesOperation
2023-03-24The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404
2022-10-28The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
    Added Error Codes: 403
    Added Error Codes: 404
2022-09-15The error codes of the API operation change.,The response structure of the API operation changes.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
Output ParametersThe response structure of the API operation changes.
2022-09-15The error codes of the API operation change.,The response structure of the API operation changes.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
Output ParametersThe response structure of the API operation changes.
2022-07-08The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change