All Products
Search
Document Center

ApsaraDB for MongoDB:ResetAccountPassword

Last Updated:Jan 17, 2023

You can call this operation to reset the password of the root account of an ApsaraDB for MongoDB instance.

Operation Description

Note This operation can reset only the password of the root account of an instance.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All resources is used in the Resource type column of the operation.
  • Condition keyword: refers to the condition keyword defined by the cloud product itself.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operate access level Resource type conditional keyword Association operation
dds:ResetAccountPassword WRITE
  • MongoDB
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    without
without

Request parameters

Parameter Type Required Description Example
DBInstanceId string Yes

The ID of the instance.

dds-bpxxxxxxxx
AccountName string Yes

The account for which you want to reset the password. Set the value to root.

root
AccountPassword string Yes

The new password.

  • The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include ! # $ % ^ & * ( ) _ + - =
  • The password must be 8 to 32 characters in length.
Ali!123456

Response parameters

Parameter Type Description Example
object
RequestId string

The ID of the request.

06CBD06E-ABC9-4121-AB93-3C3820B3E7E6

Example

Normal return example

JSONFormat

{
  "RequestId": "06CBD06E-ABC9-4121-AB93-3C3820B3E7E6"
}

Error codes

Http code Error code Error message
400 InvalidAccountPassword.Malformed Specified parameter AccountPassword is not valid.
400 InvalidAccountName.NotFound The AccountName provided does not exist in our records.
400 InvalidAccountName.Malformed The specified parameter AccountName is not valid.
400 InvalidAccountPassword.Malformed The specified parameter 'AccountPassword' is not valid.
403 OperationDenied.AccountStatus The operation is not permitted due to status of account.
403 OperationDenied.AccountType The operation is not permitted due to type of account.

For a list of error codes, visit the API error center.