View current identity roles

View the roles that the current calling identity has in the target workspace to confirm its executable permission range.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/me/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

Shell
curl -X GET "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/me/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.

X-MOI-Role-ID

string

No

Request header, explicit candidate role ID. A single positive signed 64 bit integer. It must be a role that is directly bound and enabled by the current identity.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "roles": [
      {
        "role_id": "123",
        "role_name": "数据分析员",
        "lifecycle_state": "active",
        "lifecycle_version": 1,
        "system_role": false,
        "selectable": true,
        "disabled_reason": ""
      }
    ],
    "default_role_id": "123",
    "default_role_version": 2,
    "explicit_role_id": "",
    "effective_role_id": "123",
    "role_context_status": "ready",
    "schema_version": "schema-v1",
    "capability_version": "capability-v1",
    "request_id": "req-001",
    "trace_id": "trace-001"
  }
}

Field

Type

Description

code

string

OK when the request is processed successfully.

msg

string

Descriptive text for request processing.

data

object

response data.

data.roles

array of object

The roles that the current identity is directly bound to and their optional status.

data.roles[].role_id

string

The value of field role_id.

data.roles[].role_name

string

Character name.

data.roles[].lifecycle_state

string

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

data.roles[].lifecycle_version

integer

Current character lifecycle version.

data.roles[].system_role

boolean

Whether it is a system role.

data.roles[].selectable

boolean

Whether the current identity can select this role.

data.roles[].disabled_reason

string

Reason for unavailability. Empty string when available. Value: ``、ROLE_NOT_ACTIVE、ROLE_PROVISIONING_NOT_READY.

data.default_role_id

string

Current default role ID.

data.default_role_version

integer

Default character version.

data.explicit_role_id

string

An explicit role ID specified in the request and verified. Empty if not specified.

data.effective_role_id

string

The role ID ultimately used in this request.

data.role_context_status

string

Current character status. Values: default_missing, candidate_invalid, role_disabled, ready.

data.schema_version

string

Permission Schema version.

data.capability_version

string

Version of permission capability information.

data.request_id

string

Request association ID.

data.trace_id

string

Link tracking ID.

Error response

JSON
{
  "code": "ErrIAMCoreUnavailable",
  "msg": "服务暂时不可用",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

error message.

data

null

—。

Last updated on