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.

HTTP
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.

Shell
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

workspace_id

string

Yes

Target workspace ID.

Query parameters

Parameter

Type

Required

Description

resource_type

string

Yes

The resource type to view.

action_id

string

No

Fill in according to resource type. See the table below to see if it can be omitted.

purpose

string

No

Call scene identifier.

parent_id

string

No

View only resources under the specified parent resource.

q

string

No

Search by name or path.

cursor

string

No

The cursor returned from the previous page.

limit

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

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [],
    "next_cursor": "",
    "capability_status": "ready",
    "reason_code": "",
    "request_id": "req-001",
    "trace_id": "trace-001"
  }
}

Field

Type

Description

data.items

array of object

Authorizable resources for the current page.

data.items[].resource_id

string

Resource ID.

data.items[].display_name

string

Display name.

data.items[].description

string

Description.

data.items[].parent_id

string

Parent object ID.

data.items[].path

array of string or null

path.

data.items[].lifecycle_state

string

life cycle status.

data.items[].selectable

boolean

Is it optional?

data.items[].disabled_reason

string

Reason for deactivation.

data.items[].owner_role_id

string

Owner role ID.

data.items[].ownership_version

integer

Ownership version.

data.next_cursor

string

Next page cursor. When empty there is no next page.

data.capability_status

string

Resource query status. This interface always returns ready.

data.reason_code

string

Reason code when a resource query is unavailable or unsupported. This interface always returns an empty string.

data.request_id

string

Request association ID.

data.trace_id

string

Link tracking ID.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

error message.

data

null

—。

Last updated on