Get displayable resource actions

Query actions displayable for a Catalog, database, or volume under the current identity. Action hints support interface display; actual execution is authorized again.

POST https://api.moi.matrixorigin.cn/v5/catalog/allowed-actions

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5. For private deployments, use the corresponding product API URL.

First obtain resource IDs of the same type from the current Workspace’s lists. Prepare a personal access token with corresponding read privileges and a Workspace ID. BASE_URL includes the same environment’s product prefix. MOI_KEY is the product credential and WORKSPACE_ID the Workspace ID. Example IDs/data are placeholders.

Request body

curl --fail-with-body -sS -X POST "$BASE_URL/catalog/allowed-actions" \
  -H "X-API-Key: $MOI_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"resource_type": "catalog", "resource_ids": ["31", "32"]}'

Field

Type

Required

Description

resource_type

string

Yes

Resource type: catalog, database, or volume.

resource_ids

string[] (array of strings)

Yes

1–100 resource IDs of the same type.

IDs must be distinct canonical positive decimal integer strings, without spaces, plus signs, or leading zeroes. Queries only request candidates without expanding child resources.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [
      {
        "resource_id": "31",
        "allowed_actions": [
          "catalog.create_database"
        ]
      },
      {
        "resource_id": "32",
        "allowed_actions": []
      }
    ]
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.items

object[] (array of objects)

Candidate resources and action hints.

data.items[].resource_id

string

Resource ID.

data.items[].allowed_actions

string[] (array of strings)

Currently displayed actions; may be empty. System-reserved resources and subscribed databases may suppress write actions.

Error responses

{
  "code": "ErrParamInvalid",
  "msg": "示例错误信息"
}

HTTP

code

Condition

400

ErrParamInvalid

Invalid resource type, ID count, format, or duplicates.

503

ErrCoreAuthorizeUnavailable

Permission projection unavailable. Retain the actual error rather than treating it as empty authorization.

Use actual returned code, msg, and diagnostic fields for identity, permission, and dependency failures. Error text may vary by language.

Last updated on