View role inheritance relationships¶
View the direct parent role and current inheritance relationship of the specified role to provide a basis for adding or deleting inheritance relationships.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/roles/{role_id}/inheritance
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" \
-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": {
"edges": [
{
"child_role_id": "role-001",
"parent_role_id": "role-parent",
"with_grant_option": false,
"grant_id": "grant-001"
}
],
"role_graph_version": "graph-v1"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
Root role ID. |
|
array of object |
The direct inheritance edge of the current role. |
|
string |
Subrole ID. |
|
string |
Parent role ID. |
|
boolean |
Omit this field or send false. true is currently rejected. |
|
string |
Inherit authorization ID. |
|
string |
Current character diagram version. |
Confirm inheritance relationship
Before adding or deleting role inheritance, first confirm the current direct parent role relationship, and prepare for changes based on the current relationship read on this page.
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. |