您的位置:首页 > 其它

阿里云RDS文档概述——账号管理

2014-11-30 10:45 134 查看
该系列博客的目录:
概述与请求方式: /article/11271808.html (请先看这篇了解公共请求参数)
实例管理: /article/11271809.html
数据库管理: /article/11271810.html
数据迁入: /article/11271811.html
账号管理: /article/11271812.html
备份恢复: /article/11271813.html
监控查询: /article/11271814.html
日志查询: /article/11271815.html
性能优化: /article/11271816.html
参数设置: /article/11271808.html

帐号管理

创建帐号
重置密码
授权帐号权限
撤销帐号权限
查看帐号列表
删除帐号
修改帐号备注

创建帐号:
描述:
说明:

为数据库创建帐号,同一个用户实例下,一个帐号可以对多个数据库进行操作,同一帐号对不同数据库权限可以不一致。
实例/数据库状态要求:必须满足以下条件,否则将创建失败:
当前实例状态:运行中
当前数据库状态:运行中

当前实例没有被锁定

没有超出单个实例内的最大帐号数量
请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值:CreateAccount
DBInstanceId
String

实例名
AccountName
String

操作帐号,需惟一性检查,由小写字母,数字、下划线组成,字母开头,长度不超过16个字符。其他非法字符:见禁用关键字表
AccountPassword
String

操作密码,由字母、数字或下划线组成,长度为6~32位
AccountDescription
String

帐号备注,长度不超过256个字符注:不能以http://,https开头。以中文、英文字母开头。可以包含中文、英文字符、”_”,”
-”,数字字符长度2~256
示例:
请求示例:

https://rds.aliyuncs.com/?Action=CreateAccount

&AccountName=testacc02

&AccountPassword=pw1234

&DBInstanceId=riauvjz6zajfiq6ba1370329449201
&<公共请求参数>
返回示例:
XML格式:

<CreateAccountResponse>

<RequestId>D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD</RequestId>

</CreateAccountResponse>
JSON格式:

{

"RequestId":"D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD"

}

重置密码:

描述:

说明:重置帐号的密码

必须满足以下条件,否则将操作失败

当前实例状态: 运行中

没有被锁定

请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值:ResetAccountPassword
DBInstanceId
String

实例名
AccountName
String

帐号名
AccountPassword
String

新密码,由字母、数字或下划线组成,长度为6~32位
示例:

请求示例:

https://rds.aliyuncs.com/?Action=ResetAccountPassword

&AccountName=testacc02

&AccountPassword=newpw1234

&DBInstanceId=riauvjz6zajfiq6ba1370329449201

&<公共请求参数>

返回示例:

XML格式:

<ResetAccountPasswordResponse>

<RequestId>D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD</RequestId>

</ResetAccountPasswordResponse>

JSON格式:

{

"RequestId": "D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD"

}

授权帐号权限:
描述:
说明:授权帐号访问数据库、权限:一个帐号可关联一个或多个数据库。
如果指定的账号对指定数据库已经具有访问权限,则会直接返回成功。
实例状态要求:

运行中
请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值:GrantAccountPrivilege
DBInstanceId
String

实例名
AccountName
String

帐号名
DBName
String

设置与该帐号关联的数据库名数据库名称
AccountpPrivilege
String

帐号权限,ReadOnly只读,ReadWrite读写
示例:
请求示例:

https://rds.aliyuncs.com/?Action=GrantAccountPrivilege

&AccountName=testacc02

&AccountPrivilege=readwrite

&DBName=testdb03

&DBInstanceId=riauvjz6zajfiq6ba1370329449201
&<公共请求参数>
返回示例:
XML格式:

<GrantAccountPrivilegeResponse>

<RequestId>81BC9559-7B22-4B7F-B705-5F56DEECDEA7</RequestId>

</GrantAccountPrivilegeResponse>
JSON格式:

{

"RequestId":"81BC9559-7B22-4B7F-B705-5F56DEECDEA7"

}

撤销帐号权限:
描述:
说明:可用该接口删除某个帐号对DB的访问权限
必须满足以下条件,否则将删除失败:

当前数据库实例状态为:运行中

当前数据库状态为:运行中
请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值: RevokeAccountPrivilege
DBInstanceId
String

实例名
AccountName
String

帐号名
DBName
String

数据库名称
示例:
请求示例:

https://rds.aliyuncs.com/?Action=RevokeAccountPrivilege

&AccountName=testacc02

&DBName=testdb03

&DBInstanceId=riauvjz6zajfiq6ba1370329449201
&<公共请求参数>
返回示例:
XML格式:

<RevokeAccountPrivilegeResponse>

<RequestId>E22099CA-A61E-4992-A0B7-CE82DC175626</RequestId>

</RevokeAccountPrivilegeResponse>
JSON格式:

{

"RequestId":"E22099CA-A61E-4992-A0B7-CE82DC175626"

}

查看帐号列表:
描述:
说明:查找指定实例、指定DB的帐户列表信息或某个指定帐号的信息。
实例状态要求:无
请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值:DescribeAccounts
DBInstanceId
String

实例名
AccountName
String

数据库帐号
返回参数

名称
类型
描述
Accounts
List<DBInstanceAccount>
由Account组成的数组
DBInstanceAccount:

名称
类型
描述
DBInstanceId
String
帐号所属实例名称
AccountName
String
DB操作帐号名称
AccountStatus
Integer
帐号状态,Unavailable:不可用;Available:可用
AccountDescription
String
帐号备注信息
DatabasePrivileges
List<DatabasePrivilege>
由DatabasePrivilege组成的数组
DatabasePrivilege:

名称
类型
描述
DBName
String
数据库名称
AccountPrivilege
String
DB操作帐号名称
示例:
请求示例:

https://rds.aliyuncs.com/?Action=DescribeAccounts

&DBInstanceId=rdsubauieubauie
&<公共请求参数>
返回示例:
XML格式:

<DescribeAccountsResponse>

<RequestId>2603CA96-B17D-4903-BC04-61A2C829CD94</RequestId>

<Accounts>

<DBInstanceAccount>

<AccountName>MySQL</AccountName>

<DBInstanceId>testdb</DBInstanceId>

<AccountStatus>utf8</AccountStatus>

<AccountDescription></AccountDescription>

<DatabasePrivileges>

<DatabasePrivilege></DatabasePrivilege>

</DatabasePrivileges>

<DBInstanceAccount>

</Accounts>

</DescribeAccountsResponse>
JSON格式:

{

"Accounts":{

"DBInstanceAccount":[

{

"AccountDescription":"",

"DBInstanceId":"rdsubauieubauie",

"DatabasePrivileges":{

"DatabasePrivilege":[]

},

"AccountStatus":"Unavailable",

"AccountName":"testaccount"

}

]

},

"RequestId":"8D9A9689-F108-43B4-9D2E-0A52FF42B008"

}

删除帐号:
描述:
说明:调用此接口可以直接删除数据库帐号
实例状态要求:运行中
请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值:DeleteAccount
DBInstanceId
String

实例名
AccountName
String

操作帐号,需惟一性检查,由小写字母,数字、下划线组成,字母开头,长度不超过16个字符。其他非法字符:见禁用关键字表
示例:
请求示例:

https://rds.aliyuncs.com/?Action=DeleteAccount

&DBInstanceId=riaqu32iiaeiyeuya1370317952018

&AccountName=wangyichengtest
&<公共请求参数>
返回示例:
XML格式:

<DeleteAccountResponse>

<RequestId>91E855E5-7E80-4955-929B-C74EE1D38C66</RequestId>

</DeleteAccountResponse>
JSON格式:

{

"RequestID":"91E855E5-7E80-4955-929B-C74EE1D38C66"

}

修改帐号备注:

描述:

说明: 修改数据库名的备注名,用于方便用户记录该实例,比如为该实例修改备注名为“阿里云测试环境实例帐号A”

请求参数:

名称
类型
是否必须
描述
Action
String

系统规定参数,取值:ModifyAccountDescription
DBInstanceId
String

实例名
AccountName
String

操作帐号,需惟一性检查,由小写字母,数字、下划线组成,字母开头,长度不超过16个字符。其他非法字符:见禁用关键字表
AccountDescription
String

修改帐号备注 注:不能以http://,https开头。以中文、英文字母开头。可以包含中文、英文字符、”_”,” -”,数字字符长度2~256
示例:

请求示例:

https://rds.aliyuncs.com/?Action=ModifyAccountDescription

&DBInstanceId=rdsaiiabnaiiabn

&AccountName=wangyichengtest

&AccountDescription=testAccoutdescribe

&<公共请求参数>

返回示例:

XML格式:

<ModifyAccountDescription>

<RequestId>17F57FEE-EA4F-4337-8D2E-9C23CAA63D74</RequestId>

</ModifyAccountDescription>

JSON格式:

{

"RequestId":" 17F57FEE-EA4F-4337-8D2E-9C23CAA63D74"

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: