Query calculation specification management permissions

Query whether the current identity can create, update, or enable or disable the computing specifications of the current workspace.

GET https://moi.matrixorigin.cn/newmoi/compute-resource-specs/management-permission

Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: The workspace ID to be queried is passed through the X-Workspace-ID Header.

Returning false means that the current identity does not have specification management rights; do not call create, update, enable, or deactivate interfaces at this time.

Request example

curl "https://moi.matrixorigin.cn/newmoi/compute-resource-specs/management-permission" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Successful response

Returns 200 on success. data.can_manage_specs indicates whether the current identity has specification management permissions.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "can_manage_specs": false
  }
}

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

Permission query results.

data.can_manage_specs

boolean

true means that the computing specifications can be managed; false means that it does not have this permission.

Error response

{
  "code": "ErrApiKeyInvalid",
  "msg": "API key is invalid or expired",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

401

Missing or invalid access credentials.

Check API Key and Workspace Header.

500

GET_SPEC_MANAGEMENT_PERMISSION_FAILED

The server cannot read the permission result.

Try again later; if it continues to fail, contact support.

Follow-up operations

When data.can_manage_specs is true, you can Create calculation specification; when it is false, contact the workspace administrator to apply for permission.

Last updated on