Description
Modifies the global privileges of a role.
Call instructions
Interface constraints
The caller needs to be authenticated through the OCP application service.
The caller must have the privilege to modify the specified tenant.
Request path
POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/roles/{roleName}/modifyGlobalPrivilege
Request parameters
path:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| id | Integer | Yes | 1 | The cluster ID. |
| tenantId | Integer | Yes | 5 | The tenant ID. |
| roleName | String | Yes | ROLE1 | The name of the role. |
body:
Parameter |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| globalPrivileges | ArrayString | Yes | [SELECT, CREATE] | The new list of system privileges for the role. |
Response
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
Modify the global privileges of the ROLE1 role to [CREATE_SESSION, CREATE_TABLE] in cluster 1 and tenant 1000001.
POST /api/v2/ob/clusters/1/tenants/2000001/roles/ROLE1/modifyGlobalPrivilege?id=1&tenantId=2000001&username=USER1
{
"globalPrivileges": [
"CREATE_SESSION",
"CREATE_TABLE"
]
}
Response example
{
"duration": 201,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-07T15:30:41.205+08:00",
"traceId": "f4783564b21746db"
}
