View role list

View the roles in the current workspace and their modifiable status, and select the target role for role management, authorization, and inheritance configuration.

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

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. Prepare personal access token and target workspace ID that can access the target workspace.

Request parameters

Replace $WORKSPACE_ID, $CLOUDSIGMA_API_KEY in the example with actual values.

Shell
curl -X GET "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/roles" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

workspace_id

string

Yes

Target workspace ID.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "roles": [
      {
        "role_id": "role-001",
        "role_name": "analyst",
        "description": "数据分析角色",
        "lifecycle_state": "active",
        "lifecycle_version": 3,
        "system_role": false,
        "protected_role": false,
        "policy_mutation_allowed": true,
        "created_at": 0,
        "updated_at": 0,
        "system_role_name": ""
      }
    ],
    "request_id": "req-001",
    "trace_id": "trace-001"
  }
}

Field

Type

Description

data.roles

array of object

Roles in the current workspace.

data.roles[].role_id

string

Role ID.

data.roles[].role_name

string

Character name.

data.roles[].description

string

Role description.

data.roles[].lifecycle_state

string

Role life cycle status. Values: active, disabled, deleted.

data.roles[].lifecycle_version

integer

Role lifecycle versions.

data.roles[].system_role

boolean

Whether it is a system role.

data.roles[].protected_role

boolean

Whether it is a protected role.

data.roles[].policy_mutation_allowed

boolean

Whether modification of the role’s policy is currently allowed.

data.roles[].created_at

integer

Creation time.

data.roles[].updated_at

integer

Update time.

data.roles[].system_role_name

string

System role stable name. Values: empty string, superadmin, admin, empty.

data.request_id

string

Request association ID.

data.trace_id

string

Link tracking ID.

Select role

Select the role to manage, authorize, or configure inheritance relationships. Subsequent modifications to the role should be based on the current role status read here to avoid overwriting other people’s concurrent changes.

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