View the role inheritance graph¶
View the complete role relationships that a specified role can inherit from, to identify indirect inheritance and potential loops.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/roles/{role_id}/inheritance-graph
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.
Prepare personal access token and target workspace ID that can access the target workspace.
Request parameters¶
Replace $WORKSPACE_ID, $ROLE_ID, $CLOUDSIGMA_API_KEY in the example with actual values.
curl -X GET "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/inheritance-graph" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
|
string |
Yes |
Target role ID. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"root_role_id": "role-001",
"edges": [],
"role_graph_version": "graph-v1"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
The root role ID of the inheritance graph. |
|
array of object |
Reachable characters inherit edges. |
|
string |
Accept role ID. |
|
string |
Grant role ID. |
|
boolean |
Omit this field or send false. true is currently rejected. |
|
string |
Authorization ID. |
|
string |
Current character diagram version. |
Confirm inheritance diagram
Before adding an inheritance relationship, check the complete role relationship and confirm that the new relationship will not form a cycle.
Error response¶
Normal errors only return code and msg. When core error codes are present, data may contain request_id, trace_id, and core_error_code. Parse results by error response fields.
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |
data |
object |
Only errors carrying core error codes return this object. Other errors are omitted. |
data.request_id |
string |
Current request identifier. |
data.trace_id |
string |
The tracking ID of the current request. |
data.core_error_code |
string |
Core error code. |