Query Worker runtime¶
Query the runtime replica status of a compute instance by Worker type.
GET $CLOUDSIGMA_API_BASE/compute-resources/{resource_id}/runtime
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First Query the computing instance details] and confirm the instance you want to query.
Set the operation-specific values used in the request:
$RESOURCE_ID: The computing instance ID to be queried.
Request¶
curl "$CLOUDSIGMA_API_BASE/compute-resources/$RESOURCE_ID/runtime" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Compute instance ID. |
Successful response¶
Returns 200 on success, data.runtimes lists the runtime records of each type of Worker.
{
"code": "OK",
"msg": "OK",
"data": {
"runtimes": [
{
"compute_resource_id": "cr-001",
"worker_type": "python-worker",
"status": "ACTIVE",
"desired_replicas": 1,
"current_replicas": 1
}
]
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Worker runtime object. |
|
object[] |
Runtime records for each type of Worker. |
|
string |
Compute instance ID. |
|
string |
Worker type. |
|
string |
The running status of this Worker. |
|
integer |
Number of target copies. |
|
integer |
The current number of copies. |
|
string |
Last activation time; returned if there is a value. |
|
string |
Last active time; returned if there is a value. |
|
string |
Runtime record creation time. |
|
string |
Record the last update time during runtime. |
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.runtimes[].compute_resource_id is the compute_resource_id field of each item in data.runtimes.
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 the regional endpoint, API key, and workspace ID. |
|
|
The current identity does not have permission to read the running status of 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 |
|
|
The service cannot read the Worker running status. |
Record the request time and error message and try again. |
Follow-up operations¶
Return to Query calculation instance details to view the overall status, or Update calculation instance to adjust the configuration.