View role inheritance relationships

View a specified role’s direct parent roles and current inheritance relationships before adding or removing inheritance.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/roles/{role_id}/inheritance

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First select the role.

Request parameters

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

On success, returns direct inheritance edges for the role and the current role graph version. Submit this version when you update inheritance.

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

code

string

OK on success.

msg

string

OK on success.

data.edges

object[]

Direct inheritance edges for the role.

data.edges[].child_role_id

string

Child role ID.

data.edges[].parent_role_id

string

Parent role ID.

data.edges[].with_grant_option

boolean

Whether the inheritance grants grant option.

data.edges[].grant_id

string

Inheritance grant ID.

data.role_graph_version

string

Current role graph version.

Error response

JSON
{"code": "ErrParamInvalid", "msg": "请求参数无效", "data": null}

Field

Type

Description

code

string

Error code.

msg

string

Error message.

data

null

—

Next steps

Confirm inheritance relationships

Before adding or removing role inheritance, confirm the current direct parent-role relationships and use the current relationship shown on this page to prepare the change.

Last updated on