You can call this operation to modify the attributes of an ApsaraDB for Redis instance, including the name and password.

For more information about how to perform the corresponding operation in the console, see Change the password.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyInstanceAttribute

The operation that you want to perform. Set this parameter to ModifyInstanceAttribute.

InstanceId String Yes r-j6cxxxxxxxxxxxxx

The ID of the instance for which you want to modify attributes.

InstanceName String No newinstancename

The name of the new instance. The name can be 2 to 80 characters in length and must start with a letter. The following characters are not supported: at signs (@), forward slashes (/), colons (:), equal signs (=), double quotation marks ("), angle brackets (<>), braces ([]), curly brackets ({}) and spaces.

NewPassword String No uW8+nsrp

The new password of the instance. The password can be 8 to 32 characters in length and must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. Special characters include ! at signs (@), number signs (#), dollar signs ($), percent signs (%), carets (^), ampersands (&), asterisks (*), parentheses (()), underscores (_), plus signs (+), hyphens (-), and equal signs (=).

Response parameters

Parameter Type Example Description
RequestId String 8D0C0AFC-E9CD-47A4-8395-5C31BF9B3E76

The ID of the request.

Examples

Sample request


https://r-kvstore.aliyuncs.com/
? Action=ModifyInstanceAttribute
&InstanceId=r-j6cxxxxxxxxxxxxx
&InstanceName=demo
&NewPassword=uW8+nsrp
&<Common request parameters>

Sample success response

XML format

<ModifyInstanceAttributeResponse>
  <RequestId>8D0C0AFC-E9CD-47A4-8395-5C31BF9B3E76</RequestId>
</ModifyInstanceAttributeResponse>

JSON format

{
	"RequestId":"EFC9161F-15E3-4A6E-8A99-C09916D1F464"
}

Error codes

HTTP status code Error code Error message Description
400 MissingParameter InstanceName/NewPassword at least one is mandatory for this action. The error message returned because the name or new password of the instance is required.
400 InvalidInstanceName.Malformed The Specified parameter "InstanceName" is not valid. The error message returned because the verification of the instance name failed.
400 InvalidPassword.Malformed The Specified parameter "NewPassword" is not valid. The error message returned because the verification of the new password failed.

View error codes.