You need to enable JavaScript to run this app.
导航
DescribeDBAccounts
最近更新时间:2024.11.08 10:14:35首次发布时间:2022.04.12 19:05:15

调用 DescribeDBAccounts 接口查询实例的账号信息。

请求类型

同步请求。

调试

请求参数

名称类型是否必选示例值描述

InstanceId

String

vedbm-r3xq0zdl****

实例 ID。

说明

您可以调用 DescribeDBInstances 接口查询实例 ID。

PageSizeInteger10每页记录数。取值范围 1~1000,默认值为 10。
PageNumberInteger1页码。取值大于等于 1,且不超过 Integer 的最大值,默认值为 1。
AccountNameStringtestuser1数据库账号名称,支持模糊查询。

返回参数

名称类型示例值描述
TotalInteger1账号总数。
AccountsArray of AccountObject请参见返回示例账号列表。详细信息,请参见 AccountObject

请求示例

POST /?Action=DescribeDBAccounts&Version=2022-01-01 HTTP/1.1
Content-Type: application/json
Host:vedbm.volcengineapi.com
X-Date: 20220101T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20220101/cn-beijing/vedbm/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c645****

{
        "InstanceId": "vedbm-ca12cbqv****",
        "PageNumber" : 1,
        "PageSize" : 10
}

返回示例

正常返回示例

{
    "ResponseMetadata": {
        "RequestId": "202406261717167860DC3556BF29132202-461255",
        "Action": "DescribeDBAccounts",
        "Version": "2022-01-01",
        "Service": "vedbm",
        "Region": "cn-chongqing-sdv"
    },
    "Result": {
        "Accounts": [
            {
                "AccountName": "test_user",
                "AccountPrivileges": [],
                "AccountType": "Super"
            },
            {
                "AccountName": "test3",
                "AccountPrivileges": [
                    {
                        "AccountPrivilege": "ReadWrite",
                        "AccountPrivilegeDetail": "SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES,CREATE VIEW,SHOW VIEW,CREATE ROUTINE,ALTER ROUTINE,EXECUTE,EVENT,TRIGGER",
                        "DBName": "db1"
                    },
                    {
                        "AccountPrivilege": "ReadOnly",
                        "AccountPrivilegeDetail": "SELECT,LOCK TABLES,SHOW VIEW",
                        "DBName": "db2"
                    },
                    {
                        "AccountPrivilege": "Custom",
                        "AccountPrivilegeDetail": "SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES",
                        "DBName": "db3"
                    }
                ],
                "AccountType": "Normal"
            },
        ],
        "Total": 2
    }
}

错误码

更多详情,请参见错误码