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.

HTTP
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.

Shell
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

workspace_id

string

Yes

Target workspace ID.

role_id

string

Yes

Target role ID.

request_id

string

Yes

The new idempotent request ID generated by the caller for this fix.

Request body

Field

Type

Required

Description

request_id

string

Yes

The new idempotent request ID generated by the caller for this fix. Cannot be empty.

expected_data_privilege_version

integer

No

The expected data permission version cannot be less than 0. Default 0. Not less than 0.

Successful response

JSON
{
  "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

data.request_id

string

This repair request ID is used to view the repair operation.

data.trace_id

string

Link tracking ID.

data.operation_id

string

Repair operation ID generated by the server.

data.audit_event_id

string

Fix audit event ID.

data.state

string

Repair status: applying, succeeded, failed, drifted, or unknown. Values: succeeded, failed, drifted, unknown.

data.data_privilege_version

integer

Fixed data permissions version.

data.idempotent_replay

boolean

Whether it is an idempotent replay of the same repair request.

data.session_invalidation_status

string

Session permission refresh status. Values: new_connections_only, all_sessions_refreshed, not_applicable, unknown.

data.matrixone_fact_version

string

OmniFabric permissions fact version.

data.resource_results

array of object

Repair results for each resource. At least 1 items.

data.resource_results[].resource_type

string

Resource type. Value: database, table.

data.resource_results[].resource_id

string

Resource ID.

data.resource_results[].action_id

string

Permission actions.

data.resource_results[].privilege_key

string

Permission key. Values: create_table, select, insert, update, delete.

data.resource_results[].operation

string

operation. Value: grant, revoke.

data.resource_results[].state

string

Running status. Values: succeeded, failed, drifted, unknown.

data.resource_results[].session_invalidation_status

string

Session permission update status. Values: new_connections_only, all_sessions_refreshed, not_applicable, unknown.

data.resource_results[].matrixone_fact_version

string

MatrixOne permissions fact version.

data.resource_results[].error_code

string

error code. Values: empty string, data_privilege_validation_failed, authorization_revoked, resource_changed, version_conflict, matrixone_unavailable, data_privilege_drifted, matrixone_apply_failed, decision_unknown.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

error message.

data

null

—。

Last updated on