Description
Grants global privileges to a user.
Call instructions
API constraints
The caller must be authenticated through OCP.
The caller must have the privilege to modify the specified tenant.
Request path
POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/users/{username}/grantGlobalPrivilege
Request parameters
Path parameters
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | Cluster ID |
| tenantId | Integer | Yes | 5 | Tenant ID |
| username | String | Yes | root | Username |
| hostName | String | No | 33.47.251.% | Host name |
Body parameters
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| globalPrivileges | ArrayString | Yes | [SELECT, CREATE] | The list of global privileges to grant: |
Return result
Parameter |
Type |
Description |
|---|---|---|
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code that conforms to the HTTP status specification. |
| traceId | String | The Trace ID of the request, which is used for troubleshooting. |
| server | String | The address of the application service that responded to the request. |
Examples
Request example
Grant the CREATE_SESSION privilege to the user USER1 in cluster 1, tenant 1000001.
POST /api/v2/ob/clusters/1/tenants/2000001/users/USER1/grantGlobalPrivilege?id=1&tenantId=2000001&username=USER1
{
"globalPrivileges": [
"CREATE_SESSION"
]
}
Return example
{
"duration": 201,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-07T15:30:41.205+08:00",
"traceId": "f4783564b21746db"
}
