调用DescribeAccounts接口查询PolarDB集群的数据库账号信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 否 | DescribeAccounts |
系统规定参数,取值为DescribeAccounts。 |
DBClusterId | String | 是 | pc-*************** |
集群ID。 |
AccountName | String | 否 | test_acc |
账号名称。 |
PageNumber | Integer | 否 | 1 |
页码,取值范围为大于0但不超过Integer最大值的整数,默认值为1。 |
PageSize | Integer | 否 | 30 |
每页记录数,取值范围如下:
默认值为30。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Accounts | Array of DBAccount |
账号信息详情。 |
|
AccountDescription | String | test |
账号备注。 |
AccountLockState | String | UnLock |
账号锁定状态:
|
AccountName | String | test_acc |
账号名。 |
AccountPasswordValidTime | String | undefined |
密码过期时间。 |
AccountStatus | String | Available |
账号状态:
|
AccountType | String | Normal |
账户类型:
|
DatabasePrivileges | Array of DatabasePrivilege |
目标账号拥有的数据库权限详情。 说明 仅普通账号返回该参数。
|
|
AccountPrivilege | String | ReadOnly |
账号权限。 |
DBName | String | DBtest |
数据库名称。 |
PageNumber | Integer | 1 |
页码。 |
PageRecordCount | Integer | 1 |
本页记录数。 |
RequestId | String | 155462B9-205F-4FFC-BB43-4855FE****** |
请求ID。 |
示例
请求示例
http(s)://polardb.aliyuncs.com/?Action=DescribeAccounts
&DBClusterId=pc-***************
&<公共请求参数>
正常返回示例
XML
格式
<DescribeAccountsResponse>
<PageRecordCount>1</PageRecordCount>
<RequestId>155462B9-205F-4FFC-BB43-4855FE******</RequestId>
<PageNumber>1</PageNumber>
<Accounts>
<AccountDescription>test</AccountDescription>
<AccountStatus>Available</AccountStatus>
<AccountLockState>UnLock</AccountLockState>
<AccountPasswordValidTime>undefined</AccountPasswordValidTime>
<AccountType>Normal</AccountType>
<AccountName>test_acc</AccountName>
</Accounts>
<Accounts>
<DatabasePrivileges>
<AccountPrivilege>ReadOnly</AccountPrivilege>
<DBName>DBtest</DBName>
</DatabasePrivileges>
</Accounts>
</DescribeAccountsResponse>
JSON
格式
{
"PageRecordCount": 1,
"RequestId": "155462B9-205F-4FFC-BB43-4855FE******",
"PageNumber": 1,
"Accounts": [
{
"AccountDescription": "test",
"AccountStatus": "Available",
"AccountLockState": "UnLock",
"AccountPasswordValidTime": "undefined",
"AccountType": "Normal",
"AccountName": "test_acc"
},
{
"DatabasePrivileges": {
"AccountPrivilege": "ReadOnly",
"DBName": "DBtest"
}
}
]
}
错误码
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交