查询账号列表
更新时间:2023-09-21
接口说明
- 查看指定实例的账号列表
- 本接口为v1接口
请求结构
Plain Text
1GET /v{version}/instance/{instanceId}/account HTTP/1.1
2HOST: rds.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
version | Integer | 是 | URL参数 | API版本号 |
instanceId | String | 是 | URL参数 | 实例ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
accounts | List<Account> | Account对象 |
Account 对象
参数名称 | 类型 | |
---|---|---|
accountName | String | 账号名称,不能为保留关键字 |
databasePrivileges | List<DatabasePrivilege> | MySQL和SQL Server实例可设置此项 |
type | String | 账号归属类型。 OnlyMaster:主实例上使用的账号,RdsProxy:该主实例对应的代理实例上使用的账号。默认为OnlyMaster账号,详情参考 |
accountStatus | String | 账号状态,同status |
superUserFlag | String | 同accountType字段值 |
accountType | String | 账号权限类型。 Common:普通账号,Super:super账号。默认为普通账号,详情参考 |
desc | String | 账号的描述信息 |
status | String | 账号状态,Available:可用 |
ETag | String | 账号操作时间, 如:"2023-07-28 02:45:53" |
DatabasePrivilege 字段数据结构说明
参数名称 | 类型 | 描述 |
---|---|---|
dbName | String | 数据库名称 |
authType | String | 授权类型。ReadOnly:只读,ReadWrite:读写 |
请求示例
Plain Text
1GET /v1/instance/rds-94aXRRV2/account HTTP/1.1
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 7869616F-7A68-6977-656E-406261696475
3Content-Type: application/json
4{
5 "accounts": [
6 {
7 "accountName": "test_name1",
8 "remark": "账号user2",
9 "databasePrivileges": [],
10 "type": "OnlyMaster",
11 "accountStatus": "Available",
12 "superUserFlag": "Common",
13 "accountType": "Common",
14 "desc": "账号user2",
15 "status": "Available",
16 "ETag": "2023-09-20 09:14:01"
17 },
18 {
19 "accountName": "test_name2",
20 "remark": "账号user2",
21 "databasePrivileges": [],
22 "type": "OnlyMaster",
23 "accountStatus": "Available",
24 "superUserFlag": "Common",
25 "accountType": "Common",
26 "desc": "账号user2",
27 "status": "Available",
28 "ETag": "2023-09-20 09:14:01"
29 },
30 {
31 "accountName": "test_name3",
32 "remark": "账号user2",
33 "databasePrivileges": [],
34 "type": "OnlyMaster",
35 "accountStatus": "Available",
36 "superUserFlag": "Common",
37 "accountType": "Common",
38 "desc": "账号user2",
39 "status": "Available",
40 "ETag": "2023-09-20 09:14:01"
41 },
42 {
43 "accountName": "test_name4",
44 "remark": "账号user2",
45 "databasePrivileges": [],
46 "type": "OnlyMaster",
47 "accountStatus": "Available",
48 "superUserFlag": "Super",
49 "accountType": "Super",
50 "desc": "账号user2",
51 "status": "Available",
52 "ETag": "2023-09-20 09:14:01"
53 }
54 ]
55}