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.
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.
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 |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
Successful response¶
{
"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 |
|---|---|---|
|
array of object |
Roles in the current workspace. |
|
string |
Role ID. |
|
string |
Character name. |
|
string |
Role description. |
|
string |
Role life cycle status. Values: |
|
integer |
Role lifecycle versions. |
|
boolean |
Whether it is a system role. |
|
boolean |
Whether it is a protected role. |
|
boolean |
Whether modification of the role’s policy is currently allowed. |
|
integer |
Creation time. |
|
integer |
Update time. |
|
string |
System role stable name. Values: empty string, |
|
string |
Request association 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.
{
"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. |