Applicability
Currently, this API does not support modifying user permissions in a standby cluster.
Overview
You can call this API to modify the roles of a specified user in a tenant.
API details
Constraints
The caller must have an AccessKey for accessing APIs of OceanBase Cloud. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/tenants/{tenantId}/tenantUsers/{userName}/authorization
Request parameters
Path
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | Yes | The ID of the OceanBase Cloud instance. | ob317v4uif**** |
| tenantId | string | Yes | The ID of the tenant. | t4pnum**** |
| userName | string | Yes | The name of the database account. Reserved keywords such as SYS and root cannot be used. | test |
Body
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| instanceId | string | No | The ID of the OceanBase cluster. | obcluster-***** |
| tenantId | string | No | The ID of the tenant. | t4louaeei**** |
| userName | string | No | The name of the user. | N/A |
| userRole | string | No | The role of the user. | N/A |
| modifyType | string | No | The type of modification. | N/A |
| clusterGroupName | string | No | The name of the cluster group. | N/A |
| userType | string | No | The type of the user. | N/A |
| GlobalPermissions | string | No | The global permissions. | N/A |
| UID | string | No | The unique identifier of the user. | N/A |
| User_ID | string | No | The ID of the user. | N/A |
| requestId | string | No | The ID of the request. | N/A |
| callerType | string | No | The type of the caller. | N/A |
| accessKeyId | string | No | The ID of the AccessKey. | N/A |
| securityToken | string | No | The security token. | N/A |
| callerUid | string | No | The UID of the caller. | N/A |
| callerBid | string | No | The BID of the caller. | N/A |
| stsTokenCallerUid | string | No | The UID of the caller of the STS token. | N/A |
| stsTokenCallerBid | string | No | The BID of the caller of the STS token. | N/A |
| acceptLanguage | string | No | The accepted language. | N/A |
| pageNumber | integer | No | The page number. | N/A |
| pageSize | integer | No | The number of items on a page. | N/A |
| mergedCallerBid | string | No | The merged BID of the caller. | N/A |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| N/A | unknown | The returned information after the request is successful. |
Examples
Request example
curl -X POST \
-u '<your ak:sk>' \
-H 'Content-Type: application/json' \
-H 'X-Ob-Project-Id: <Project ID>' \
-d '{
"modifyType": "UPDATE",
"userRole": "DML",
"database": "testdb"
}' \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/tenants/{tenantId}/tenantUsers/{userName}/authorization'
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID corresponding to the specified instanceId is consistent with the specified project ID.
Response example
JSON format
{
"server": "xxx.xxx.x.xxx:xxxx",
"requestId": "71f8acbe-e009-4a88-b417-8cbaf1b8ac3d",
"success": true
}
