调用ResetAccountPassword接口重置数据库账号密码。
接口说明
实例状态需要为运行中,否则操作将失败。
说明该接口暂不支持对SQL Server 2017集群版和PostgreSQL实例通过SQL创建的账号进行密码重置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
rds:ResetAccountPassword | WRITE |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
DBInstanceId | string | 是 | 实例ID。 | rm-uf6wjk5xxxxxxx |
AccountName | string | 是 | 数据库账号名称。 | test1 |
AccountPassword | string | 是 | 新密码。 说明 !@#$&%^*()_+-= | Test123456 |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "D4D4BE8A-DD46-440A-BFCD-EE31DA81C9DD"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Account.UpdateError | Update Account failed, please check your input value | 更新账户失败, 请检查请求参数,或实例参数策略配置 |
400 | Database.ConnectError | Database connect error. please check instance status and database processlist | 数据库连接异常,请检查实例状态及数据库的连接池 |
400 | GdnRole.NotSupport | Specified gdn role is not support. | gdn角色不允许删除账号。 |
400 | InvalidAccountPassword.Format | Specified account password is not valid. | 账户密码无效,请重新按照规范设置账户密码。 |
400 | IncorrectAccountStatus | Current account status does not support this operation. | 当前账号状态不支持此操作。 |
403 | IncorrectDBInstanceType | Current DB instance type does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
403 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | 实例状态非运行中 |
403 | IncorrectAccountType | Current account type does not support this operation. | 当前账户类型不支持此操作,请选择正确的账户类型。 |
403 | IncorrectDBInstanceCharacterType | Current DB Instance character_type does not support this operation. | 当前DB实例字符类型不支持此操作。 |
403 | IncorrectAccountPrivilegeType | the current account privilege type does not support this operation. | 当前账户权限类型不支持此操作 |
404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | 数据库实例名称不存在。请确认数据名称是否正确。 |
404 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | 操作失败,实例处于锁定状态。 |
404 | InvalidAccountName.NotFound | Specified account name does not exist. | 当前账户名不存在,请确认或选择正确的账户名。 |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2022-10-28 | OpenAPI 错误码发生变更 | |||||||||
| ||||||||||
2022-06-23 | OpenAPI 描述信息更新,OpenAPI 错误码发生变更 | |||||||||
|