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 the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through X-Workspace-ID Header.

  • $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

resource_id

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

code

string

OK on success.

msg

string

OK on success.

data.id

string

Compute instance ID.

data.workspace_id

string

ID of the workspace to which it belongs.

data.name

string

Compute instance name.

data.description

string

Example description; returned when there is a value.

data.spec_id

string

The compute specification ID to use.

data.kind

string

Instance type.

data.cpu

integer

CPU configuration value.

data.memory_gib

integer

Configuration value expressed in GiB of memory.

data.gpu

integer

GPU configuration value.

data.cpu_milli

integer

CPU configuration value in millicores.

data.memory_mib

integer

Configuration value expressed in MiB of memory.

data.gpu_count

integer

Number of GPUs.

data.gpu_memory_mib

integer

MiB of video memory for a single GPU.

data.gpu_cores

integer

Number of GPU cores.

data.min_replicas

integer

Serverless instances are fixed to 0.

data.max_replicas

integer

Maximum number of copies.

data.desired_replicas

integer

Number of target copies.

data.current_replicas

integer

The current number of copies.

data.go_worker_image_id

string

Go Worker image ID; returned if there is a value.

data.python_worker_image_id

string

Python Worker image ID; returned if there is a value.

data.worker_images

object[]

Worker image selection; returned when there is a value.

data.worker_images[].worker_type

string

Worker type.

data.worker_images[].image_id

string

Image ID.

data.worker_images[].platform

string

Running platform.

data.platform

string

Instance running platform; returned if there is a value.

data.auto_suspend_minutes

integer

Automatic pause waiting time.

data.is_default

boolean

Whether it is the default computing instance of the workspace.

data.status

string

Lifecycle state, such as IDLE, ACTIVE, SUSPENDED, or ERROR.

data.status_message

string

Supplementary information for the status.

data.scale_reason

string

The scaling reason provided by the server; returned if there is a value.

data.last_activation_at

string

Last activation time; returned if there is a value.

data.last_active_at

string

Last active time; returned if there is a value.

data.created_by

string

Creator ID; returned if there is a value.

data.created_at

string

Creation time; returned if there is a value.

data.updated_at

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

401

Missing or invalid access credentials.

Check API Key and Workspace Header.

403

ErrForbidden

The current identity does not have permission to read the instance.

Use valid credentials, or contact your administrator for authorization.

404

NOT_FOUND

The instance does not exist or does not belong to the current workspace.

Check resource_id and workspace.

Follow-up operations

According to status Query Worker runtime, Update calculation instance or perform life cycle operations.

Last updated on