Modifies the permissions for an account of an ApsaraDB for Redis instance.

Note
  • Only Redis 4.0 and later of the ApsaraDB for Redis instances are supported.
  • The ApsaraDB for Redis instance must be in the Running state.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GrantAccountPrivilege

The operation that you want to perform. Set the value to GrantAccountPrivilege.

InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance which belongs to the account.

AccountName String Yes demoaccount

The name of the account that you want to manage.

  • The name must start with a lowercase letter.
  • The name can contain lowercase letters, digits, and underscores (_).
  • The name must be 1 to 16 characters in length.
AccountPrivilege String Yes RoleReadWrite

The permissions that you want to grant to the account. Valid values:

  • RoleReadOnly: the read-only permissions.
  • RoleReadWrite: the read and write permissions. This is the default value.
  • RoleRepl: the copy permissions.
Note In addition to reading data from and writing data to the ApsaraDB for Redis instance, an account that is granted with the RoleRepl permission can run the SYNC and PSYNC commands. The RoleRepl permission can be granted to an account only for a standard instance of ApsaraDB for Redis that uses Redis 4.0.
RegionId String No cn-hangzhou

The ID of the region where the instance is deployed.

Response parameters

Parameter Type Example Description
RequestId String 3845BDF5-15A6-4444-B770-78501819****

The ID of the request.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=GrantAccountPrivilege
&InstanceId=r-bp1zxszhcgatnx****
&AccountName=demoaccount
&AccountPrivilege=RoleReadWrite
&<Common request parameters>

Sample success responses

XML format

<GrantAccountPrivilegeResponse>
      <RequestId>3845BDF5-15A6-4444-B770-78501819****</RequestId>
</GrantAccountPrivilegeResponse>

JSON format

{
    "RequestId": "3845BDF5-15A6-4444-B770-78501819****"
}

Error codes

For a list of error codes, visit the API Error Center.