View the role inheritance graph

View the complete role relationships that a specified role can inherit from, to identify indirect inheritance and potential loops.

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

Shell
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

workspace_id

string

Yes

Target workspace ID.

role_id

string

Yes

Target role ID.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "root_role_id": "role-001",
    "edges": [],
    "role_graph_version": "graph-v1"
  }
}

Field

Type

Description

data.root_role_id

string

The root role ID of the inheritance graph.

data.edges

array of object

Reachable characters inherit edges.

data.edges[].child_role_id

string

Accept role ID.

data.edges[].parent_role_id

string

Grant role ID.

data.edges[].with_grant_option

boolean

Omit this field or send false. true is currently rejected.

data.edges[].grant_id

string

Authorization ID.

data.role_graph_version

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.

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

Last updated on