Changes the type of permissions that are granted to an account.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. 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 ModifyAccountPrivilege

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

RegionId String Yes cn-hangzhou

The ID of the region where your PolarDB-X instance is deployed.

DBInstanceName String Yes pxc-htri0ori2r4k9p

The name of the PolarDB-X instance.

AccountName String Yes account_sec

The username of the account.

DbName String Yes sbtest

The name of the database that can be accessed by using the account.

AccountPrivilege String Yes ReadWrite

The type of permissions that you want to grant to the account.

SecurityAccountName String No account_audit

The username of the data security administrator (DSA) account.

SecurityAccountPassword String No *****

The password of the DSA account.

Response parameters

Parameter Type Example Description
Message String success

The message that is returned. If the request is successful, "success" is returned. If the request fails, an error code is returned.

RequestId String 73559800-3c8c-11ec-bd40-99cfcff3fe1e

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyAccountPrivilege
&RegionId=cn-hangzhou
&DBInstanceName=pxc-htri0ori2r4k9p
&AccountName=account_sec
&DbName=sbtest
&AccountPrivilege=ReadWrite
&SecurityAccountName=account_audit
&SecurityAccountPassword=*****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyAccountPrivilegeResponse>
    <Message>success</Message>
    <RequestId>73559800-3c8c-11ec-bd40-99cfcff3fe1e</RequestId>
    <Success>true</Success>
</ModifyAccountPrivilegeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "success",
  "RequestId" : "73559800-3c8c-11ec-bd40-99cfcff3fe1e",
  "Success" : true
}

Error codes

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