View grantable resources¶
View the resources accessible to the current identity by resource type and operation for selecting subsequent authorization targets. Being visible in the list does not mean you are qualified to grant permissions to the resource. Authorization permissions are still checked separately when submitting permission changes.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/permissions/resources
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. Start by determining the resource type and action you want to grant.
Prepare personal access token and target workspace ID with corresponding permissions for the target workspace.
Request parameters¶
Replace $WORKSPACE_ID, $CLOUDSIGMA_API_KEY in the example with actual values.
curl -G "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/permissions/resources" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "resource_type=workflow" \
--data-urlencode "action_id=workflow.read" \
--data-urlencode "limit=50"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
Query parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The resource type to view. |
|
string |
No |
Fill in according to resource type. See the table below to see if it can be omitted. |
|
string |
No |
Call scene identifier. |
|
string |
No |
View only resources under the specified parent resource. |
|
string |
No |
Search by name or path. |
|
string |
No |
The cursor returned from the previous page. |
|
integer |
No |
The quantity per page, default is 50, range is 1~100. |
Some resource types allow action_id to be omitted, and the read operation of this resource is used by default. database Operation is required. The result only indicates that the caller can perform the selected operation, and cannot be used to determine whether the caller has authorization permissions.
resource_type |
Supported action_id |
When omitted. |
|---|---|---|
catalog |
catalog.create_child、catalog.delete、catalog.read、catalog.update、database.create |
catalog.read。 |
database |
database.create_child、database.delete、database.read、database.show_tables、database.show_volumes、database.update、volume.create |
Omission is not allowed. |
table |
table.read |
table.read。 |
volume |
volume.delete、volume.read、volume.update、volume.write |
volume.read。 |
workflow |
workflow.delete、workflow.manage、workflow.read、workflow.run |
workflow.read。 |
catalog does not accept parent_id, other types are filled in according to the resource level. Except for workflow, the parent ID must be a positive integer.
Pass the returned cursor as it is to the next page request. When there is no next page, the response next_cursor is omitted.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"items": [],
"next_cursor": "",
"capability_status": "ready",
"reason_code": "",
"request_id": "req-001",
"trace_id": "trace-001"
}
}
Field |
Type |
Description |
|---|---|---|
|
array of object |
Authorizable resources for the current page. |
|
string |
Resource ID. |
|
string |
Display name. |
|
string |
Description. |
|
string |
Parent object ID. |
|
array of string or null |
path. |
|
string |
life cycle status. |
|
boolean |
Is it optional? |
|
string |
Reason for deactivation. |
|
string |
Owner role ID. |
|
integer |
Ownership version. |
|
string |
Next page cursor. When empty there is no next page. |
|
string |
Resource query status. This interface always returns |
|
string |
Reason code when a resource query is unavailable or unsupported. This interface always returns an empty string. |
|
string |
Request association ID. |
|
string |
Link tracking ID. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Field |
Type |
Description |
|---|---|---|
code |
string |
error code. |
msg |
string |
error message. |
data |
null |
—。 |