Query calculation instance details¶
Read the configuration, capacity, and lifecycle status of a compute instance.
GET https://moi.matrixorigin.cn/newmoi/compute-resources/{resource_id}
Preparation before calling¶
First list the calculation instance or create the calculation instance] and obtain resource_id. Prepare a personal access token with access to the target workspace, the target workspace ID, and the compute instance ID.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$RESOURCE_ID: The compute instance ID to be queried, taken from the list or the response of the create interface.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/compute-resources/$RESOURCE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Compute instance ID. |
Successful response¶
When successful, 200 is returned, and data is the calculation instance object.
{
"code": "OK",
"msg": "OK",
"data": {
"id": "cr-001",
"name": "data-processing",
"kind": "task",
"spec_id": "task-standard-small",
"status": "ACTIVE",
"status_message": "",
"min_replicas": 0,
"max_replicas": 2,
"current_replicas": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Compute instance ID. |
|
string |
ID of the workspace to which it belongs. |
|
string |
Compute instance name. |
|
string |
Example description; returned when there is a value. |
|
string |
The compute specification ID to use. |
|
string |
Instance type. |
|
integer |
CPU configuration value. |
|
integer |
Configuration value expressed in GiB of memory. |
|
integer |
GPU configuration value. |
|
integer |
CPU configuration value in millicores. |
|
integer |
Configuration value expressed in MiB of memory. |
|
integer |
Number of GPUs. |
|
integer |
MiB of video memory for a single GPU. |
|
integer |
Number of GPU cores. |
|
integer |
Serverless instances are fixed to |
|
integer |
Maximum number of copies. |
|
integer |
Number of target copies. |
|
integer |
The current number of copies. |
|
string |
Go Worker image ID; returned if there is a value. |
|
string |
Python Worker image ID; returned if there is a value. |
|
object[] |
Worker image selection; returned when there is a value. |
|
string |
Worker type. |
|
string |
Image ID. |
|
string |
Running platform. |
|
string |
Instance running platform; returned if there is a value. |
|
integer |
Automatic pause waiting time. |
|
boolean |
Whether it is the default computing instance of the workspace. |
|
string |
Lifecycle state, such as |
|
string |
Supplementary information for the status. |
|
string |
The scaling reason provided by the server; returned if there is a value. |
|
string |
Last activation time; returned if there is a value. |
|
string |
Last active time; returned if there is a value. |
|
string |
Creator ID; returned if there is a value. |
|
string |
Creation time; returned if there is a value. |
|
string |
Last updated time; returned if there is a value. |
In this document, [] after a type means an array; for example, object[] is an array of objects. In field paths, [] means each item in an array; for example, data.worker_images[].worker_type is the worker_type field of each item in data.worker_images.
Error response¶
{
"code": "NOT_FOUND",
"msg": "对象不存在",
"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 current identity does not have permission to read the instance. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The instance does not exist or does not belong to the current workspace. |
Check |
Follow-up operations¶
According to status Query Worker runtime, Update calculation instance or perform life cycle operations.