Overview
You can call this API to modify database user roles.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST api/v2/instances/{instanceId}/tenants/{tenantId}/databases/{databaseName}/authorization
Request parameters
Path
| Parameter | Type | Required | Description |
|---|---|---|---|
| instanceId | String | Yes | The instance ID. |
| tenantId | String | Yes | The tenant ID. |
| databaseName | String | Yes | The database name. |
Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| userRoles | Array<Object> |
Yes | The list of user role information. |
| userRoles[].userName | String | Yes | The username. |
| userRoles[].roles | Array |
Yes | The list of roles. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The request ID. |
| success | Boolean | Indicates whether the request was successful. |
Examples
Request example
curl --digest -u 'ak:sk' \
-X POST \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/databases/{databaseName}/authorization' \
--data '{
"userRoles": [
{
"userName": "testuser",
"roles": ["readwrite"]
}
]
}'
Response example
JSON format
{
"requestId": "e5b16292-ee78-4433-9233-92b9fcea0dd7",
"success": true
}