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 theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID to be queried is passed through theX-Workspace-IDHeader.
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 |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Permission query results. |
|
boolean |
|
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 |
|---|---|---|---|
|
— |
Missing or invalid access credentials. |
Check API Key and Workspace Header. |
|
|
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.