View current identity roles¶
View the roles that the current calling identity has in the target workspace to confirm its executable permission range.
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¶
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. |
|
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¶
{
"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 |
|---|---|---|
|
string |
|
|
string |
Descriptive text for request processing. |
|
object |
response data. |
|
array of object |
The roles that the current identity is directly bound to and their optional status. |
|
string |
The value of field |
|
string |
Character name. |
|
string |
Role life cycle status. Values: |
|
integer |
Current character lifecycle version. |
|
boolean |
Whether it is a system role. |
|
boolean |
Whether the current identity can select this role. |
|
string |
Reason for unavailability. Empty string when available. Value: ``、 |
|
string |
Current default role ID. |
|
integer |
Default character version. |
|
string |
An explicit role ID specified in the request and verified. Empty if not specified. |
|
string |
The role ID ultimately used in this request. |
|
string |
Current character status. Values: |
|
string |
Permission Schema version. |
|
string |
Version of permission capability information. |
|
string |
Request association ID. |
|
string |
Link tracking ID. |
Error response¶
{
"code": "ErrIAMCoreUnavailable",
"msg": "服务暂时不可用",
"data": null
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |
data |
null |
—。 |