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.

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

Shell
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

workspace_id

string

Yes

Target workspace ID.

role_id

string

Yes

Target role ID.

Successful response

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

data.root_role_id

string

Root role ID.

data.edges

array of object

The direct inheritance edge of the current role.

data.edges[].child_role_id

string

Subrole ID.

data.edges[].parent_role_id

string

Parent role ID.

data.edges[].with_grant_option

boolean

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

data.edges[].grant_id

string

Inherit authorization ID.

data.role_graph_version

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.

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