调用DescribeAccounts查找指定Redis实例的帐户列表信息或实例中某个账号的信息。
说明 本接口仅适用于4.0或以上版本的Redis实例。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeAccounts | 系统规定参数,取值:DescribeAccounts。 |
InstanceId | String | 是 | r-bp1zxszhcgatnx**** | 实例ID。 |
AccountName | String | 否 | demoaccount | 账号名,需满足以下条件:
|
RegionId | String | 否 | cn-hangzhou | 实例所属的地域ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 6C9E114C-217C-4118-83C0-B4070222**** | 请求ID。 |
Accounts | Array of Account | Redis实例的账号信息列表。 |
|
Account | |||
AccountDescription | String | testdec | 账号备注信息。 |
AccountName | String | demoaccount | 账号名称。 |
AccountStatus | String | Available | 账号状态,返回值:
|
AccountType | String | Normal | 账号类型,返回值:
|
DatabasePrivileges | Array of DatabasePrivilege | 账号权限列表。 |
|
DatabasePrivilege | |||
AccountPrivilege | String | RoleReadWrite | 账号权限,返回值:
|
InstanceId | String | r-bp10noxlhcoim2**** | 实例ID。 |
示例
请求示例
1 2 3 | https: //r-kvstore.aliyuncs.com/?Action=DescribeAccounts &InstanceId=r-bp1zxszhcgatnx**** &<公共请求参数> |
正常返回示例
XML
格式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <DescribeAccountsResponse> <RequestId>4A74FE3A-2BA8- 4574 -AB85-99C01707****</RequestId> <Accounts> <Account> <AccountStatus>Available</AccountStatus> <InstanceId>r-bp10noxlhcoim2****</InstanceId> <AccountType>Normal</AccountType> <DatabasePrivileges> <DatabasePrivilege> <AccountPrivilege>RoleReadWrite</AccountPrivilege> </DatabasePrivilege> </DatabasePrivileges> <AccountName>r-bp10noxlhcoim2****</AccountName> </Account> <Account> <AccountDescription></AccountDescription> <AccountStatus>Available</AccountStatus> <InstanceId>r-bp10noxlhcoim2****</InstanceId> <AccountType>Normal</AccountType> <DatabasePrivileges> <DatabasePrivilege> <AccountPrivilege>RoleReadWrite</AccountPrivilege> </DatabasePrivilege> </DatabasePrivileges> <AccountName>testaccount</AccountName> </Account> </Accounts> </DescribeAccountsResponse> |
JSON
格式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | { "RequestId" : "4A74FE3A-2BA8-4574-AB85-99C01707****" , "Accounts" : { "Account" : [ { "AccountStatus" : "Available" , "InstanceId" : "r-bp10noxlhcoim2****" , "AccountType" : "Normal" , "DatabasePrivileges" : { "DatabasePrivilege" : [ { "AccountPrivilege" : "RoleReadWrite" } ] }, "AccountName" : "r-bp10noxlhcoim2****" }, { "AccountDescription" : "" , "AccountStatus" : "Available" , "InstanceId" : "r-bp10noxlhcoim2****" , "AccountType" : "Normal" , "DatabasePrivileges" : { "DatabasePrivilege" : [ { "AccountPrivilege" : "RoleReadWrite" } ] }, "AccountName" : "testaccount" } ] } } |
错误码
访问错误中心查看更多错误码。