List Worker images¶
Lists the Worker images that can be selected when creating or updating a compute instance.
GET https://moi.matrixorigin.cn/newmoi/compute-resources/worker-images
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.
This interface requires compute instance creation permission.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/compute-resources/worker-images?worker_type=python-worker" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Filter by Worker type. |
|
string |
No |
Filter by mirror key. |
Successful response¶
When successful, 200 is returned, and data is the available mirror array.
{
"code": "OK",
"msg": "OK",
"data": [
{
"id": "python-worker:v1",
"worker_type": "python-worker",
"image_key": "python-worker",
"type": "python-worker",
"platform": "linux/amd64",
"is_default": true,
"status": "active"
}
]
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object[] |
Available mirror array. |
|
string |
Image ID, passed in as |
|
string |
Passed in as |
|
string |
The specification key of the image; corresponds to |
|
string |
Mirror key; corresponds to |
|
string |
Mirror label. |
|
string |
Mirror warehouse. |
|
string |
Passed in as |
|
string |
Mirror description; returned if there is a value. |
|
boolean |
Whether it is the default image for this Worker type. |
|
string |
The current status of the mirror. |
|
string |
Registration 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[].id is the id field of each item in data.
Error response¶
{
"code": "LIST_IMAGES_FAILED",
"msg": "服务端错误",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The value of |
Check the query parameters and try again. |
|
— |
Missing or invalid access credentials. |
Check API Key and Workspace Header. |
|
|
The current identity does not have permission to read available images. |
Use valid credentials, or contact your administrator for authorization. |
|
|
The service cannot read the Worker image list. |
Record the request time and error message and try again. |
Follow-up operations¶
Combine id, worker_type and platform into worker_images, then Create a calculation instance.