View role ownership impact¶
View resource ownership held by a specified role before changing or deleting it.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/roles/{role_id}/ownership-impact
Preparation before calling¶
First select the role. Prepare a personal access token with access to the target workspace and the target workspace ID.
Request parameters¶
curl -G "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/ownership-impact" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "resource_type=workflow"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
workspace_id |
string |
Yes |
Target workspace ID. |
role_id |
string |
Yes |
Target role ID. |
Query parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
resource_type |
string |
No |
Counts ownership only for the specified resource type. |
Successful response¶
On success, returns active ownership counts, counts by resource type, and sample resources. This API does not support directly deleting or transferring ownership.
{"code":"OK","msg":"OK","data":{"workspace_id":"workspace-001","role_id":"role-001","owned_count":1,"by_type":[{"resource_type":"workflow","count":1}],"items":[],"ownership_version":"ownership-v1","can_delete":false,"blocked_reason":"ACTIVE_OWNERSHIP","transfer_supported":false,"role_graph_version":"graph-v1","lifecycle_version":"3","request_id":"req-001","trace_id":"trace-001"}}
Field |
Type |
Description |
|---|---|---|
code |
string |
|
msg |
string |
|
data.role_id |
string |
Assessed role ID. |
data.owned_count |
integer |
Number of active ownerships held by the role. |
data.by_type |
object[] |
Ownership counts by resource type. |
data.items |
object[] |
Sample owned resources. |
data.ownership_version |
string |
Ownership facts version. |
data.can_delete |
boolean |
Always |
data.blocked_reason |
string |
Reason deletion is not allowed. |
data.transfer_supported |
boolean |
Always |
data.role_graph_version |
string |
Role graph version. |
data.lifecycle_version |
string |
Role lifecycle version. |
data.request_id |
string |
Request correlation ID. |
data.trace_id |
string |
Trace ID. |
Error response¶
{"code":"ErrParamInvalid","msg":"请求参数无效","data":null}
Field |
Type |
Description |
|---|---|---|
code |
string |
Error code. |
msg |
string |
Error message. |
data |
null |
— |