Repair data privilege operation¶
Reprocess data permission changes that require repair or whose results cannot be confirmed. Repair will create a new change process, and you should continue to track the results of the new process.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/roles/{role_id}/data-privilege-operations/{request_id}:repair
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First select the character. Then Query the data permission change result to confirm that the change is in a repairable state.
Prepare personal access token and target workspace ID with corresponding permissions for the target workspace.
Request body¶
Replace $WORKSPACE_ID, $ROLE_ID, $REQUEST_ID, $CLOUDSIGMA_API_KEY in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/data-privilege-operations/$REQUEST_ID:repair" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"request_id": "req-001",
"expected_data_privilege_version": 1
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
|
string |
Yes |
Target role ID. |
|
string |
Yes |
The new idempotent request ID generated by the caller for this fix. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The new idempotent request ID generated by the caller for this fix. Cannot be empty. |
|
integer |
No |
The expected data permission version cannot be less than 0. Default 0. Not less than 0. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"request_id": "repair-req-001",
"trace_id": "trace-001",
"operation_id": "operation-002",
"audit_event_id": "audit-002",
"state": "succeeded",
"data_privilege_version": 3,
"idempotent_replay": false,
"session_invalidation_status": "new_connections_only",
"matrixone_fact_version": "fact-v3",
"resource_results": [
{
"resource_type": "table",
"resource_id": "1001",
"action_id": "table.query",
"privilege_key": "select",
"operation": "grant",
"state": "succeeded",
"session_invalidation_status": "new_connections_only",
"matrixone_fact_version": "example",
"error_code": ""
}
]
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
This repair request ID is used to view the repair operation. |
|
string |
Link tracking ID. |
|
string |
Repair operation ID generated by the server. |
|
string |
Fix audit event ID. |
|
string |
Repair status: applying, succeeded, failed, drifted, or unknown. Values: |
|
integer |
Fixed data permissions version. |
|
boolean |
Whether it is an idempotent replay of the same repair request. |
|
string |
Session permission refresh status. Values: |
|
string |
OmniFabric permissions fact version. |
|
array of object |
Repair results for each resource. At least 1 items. |
|
string |
Resource type. Value: |
|
string |
Resource ID. |
|
string |
Permission actions. |
|
string |
Permission key. Values: |
|
string |
operation. Value: |
|
string |
Running status. Values: |
|
string |
Session permission update status. Values: |
|
string |
MatrixOne permissions fact version. |
|
string |
error code. Values: empty string, |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |
data |
null |
—。 |