All Products
Search
Document Center

ApsaraDB for MongoDB:ResetAccountPassword

Last Updated:Sep 03, 2024

Resets the password of the root account in an ApsaraDB for MongoDB instance.

Operation description

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • 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 Key: the condition key that is defined by the cloud service.
  • 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.
OperationAccess levelResource typeCondition keyAssociated operation
dds:ResetAccountPasswordupdate
  • Instance
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID.

dds-bpxxxxxxxx
AccountNamestringYes

The account whose password needs to be reset. Set the value to root.

root
AccountPasswordstringYes

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
CharacterTypestringNo

The role of the instance.

  • If the instance is a sharded cluster instance, this parameter is required. Valid values: db and cs.
  • If the instance is a replica set instance, you can leave this parameter empty or set the parameter to normal.
db

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

06CBD06E-ABC9-4121-AB93-3C3820B3E7E6

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400InvalidAccountPassword.MalformedSpecified parameter AccountPassword is not valid.
400InvalidAccountName.NotFoundThe AccountName provided does not exist in our records.
400InvalidAccountName.MalformedThe specified parameter AccountName is not valid.
400InvalidAccountPassword.MalformedThe specified parameter 'AccountPassword' is not valid.
403OperationDenied.AccountStatusThe operation is not permitted due to status of account.
403OperationDenied.AccountTypeThe operation is not permitted due to type of account.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-04-04The Error code has changedView Change Details
2023-03-31The Error code has changed. The request parameters of the API has changedView Change Details