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

Note
  • Only ApsaraDB for Redis instances of Redis 4.0 or later 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 to which the account belongs.

AccountName String Yes demoaccount

The name of the account. You can call the DescribeAccounts operation to obtain the name of the account.

AccountPrivilege String Yes RoleReadWrite

The permissions of the account. Default value: RoleReadWrite. Valid values:

  • RoleReadOnly: The account has the read-only permissions.
  • RoleReadWrite: The account has the read and write permissions.
RegionId String No cn-hangzhou

The region ID of the instance.

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.