List calculation specifications¶
Lists calculation specifications visible in the current workspace.
GET https://moi.matrixorigin.cn/newmoi/compute-resource-specs
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.
Reread this interface before creating an instance, and do not assume that the specifications of other workspaces are available.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/compute-resource-specs" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Successful response¶
When successful, 200 is returned. data is the calculation specification array.
{
"code": "OK",
"msg": "OK",
"data": [
{
"id": "task-standard-small",
"kind": "task",
"family": "standard",
"cpu_milli": 2000,
"memory_mib": 4096,
"gpu_count": 0,
"credit_per_hour": 1,
"enabled": true
}
]
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Specification ID, used to create computing instances. |
|
string |
Resource type. |
|
string |
Specification family identifier. |
|
string |
Specification family name. |
|
string |
English name of the specification family. |
|
integer |
CPU capacity in millicore. |
|
integer |
Memory capacity in MiB. |
|
integer |
Number of GPUs. |
|
integer |
GPU memory, unit is MiB. |
|
integer |
Number of GPU cores. |
|
number |
Credit usage per hour. |
|
string |
Specification. |
|
string |
English specifications. |
|
object |
Node scheduling configuration. |
|
boolean |
Whether the specification is enabled. |
|
boolean |
Whether it is a built-in specification of the system. |
|
string |
Creator ID. |
|
string |
The last updater ID. |
|
string |
Creation time. |
|
string |
Last updated time. |
In field paths, [] means each item in an array. For example, data[].id is the id field of each item in data.
Error response¶
{
"code": "LIST_SPECS_FAILED",
"msg": "failed to list compute resource specs",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
— |
Missing, invalid or expired access credentials. |
Check API Key. |
|
— |
The current identity does not have access to the specifications of this workspace. |
Check workspace ID and access permissions. |
|
|
The server cannot read the specification list. |
Try again later; if it continues to fail, contact support. |
Follow-up operations¶
Use id Create a calculation instance with spec enabled.