Help Center/ AI DataLake/ API Reference/ Compute Resource Management/ Querying Resource Pool Monitoring Data
Updated on 2026-11-06 GMT+08:00

Querying Resource Pool Monitoring Data

Function

This API is used to query the CPU, memory, NPU, and GPU monitoring data of a resource pool. This API is synchronous with no accompanying APIs or specific scenarios.

Calling Method

For details, see Calling APIs.

URI

GET /v2/workspaces/{workspace_id}/computes/metrics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

workspace_id

Yes

String

Definition: Workspace ID, which can be obtained by calling the Obtaining a Workspace ID API.

Constraints: N/A

Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

step

Yes

Integer

Definition: Query time step.

Constraints: N/A

Range: The unit is seconds.

  • 60: One data point per minute.

  • 3600: One data point per hour.

  • 86400: One data point per day.

Default Value: 60

metric_name

Yes

String

Definition: Metric name.

Constraints: N/A

Range

  • CPU: Resource pool CPU usage.

  • MEM: Resource pool memory usage.

  • NPU: Resource pool NPU usage.

  • GPU: Resource pool GPU usage.

Default Value: N/A

start_time

Yes

Long

Definition: Start time.

Constraints: N/A

Range: Timestamp in seconds.

Default Value: N/A

end_time

Yes

Long

Definition: End time.

Constraints: N/A

Range: Timestamp in seconds.

Default Value: N/A

compute_ids

Yes

String

Definition: Resource pool IDs, separated by commas (,). You can obtain them by calling the Listing Compute Resources API.

Constraints: N/A

Range: N/A

Default Value: N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: User token. It is obtained by calling the Obtaining an IAM User Token API.

Constraints: N/A

Range: Up to 65,534 characters. Only letters, digits, and special characters are allowed. The token format is defined by IAM. For details about the character set, see the IAM documentation.

Default Value: N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

Array of ComputeResourceMetrics objects

Definition: Resource pool metric information.

Table 5 ComputeResourceMetrics

Parameter

Type

Description

collection_time

Integer

Definition: Data time, in seconds.

Range: 0 to 2147483647.

values

Array of ComputeMetric objects

Definition: List of resource pool metric values. Each list element is a resource pool metric information object.

Table 6 ComputeMetric

Parameter

Type

Description

compute_name

String

Definition: Resource pool name.

Range: 1 to 63 characters.

compute_value

Number

Definition: Resource pool metric value. Unit: %.

Range: 0 to 100.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 512 characters.

solution_msg

String

Definition: Solution.

Range: 0 to 4,096 characters.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 512 characters.

solution_msg

String

Definition: Solution.

Range: 0 to 4,096 characters.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 512 characters.

solution_msg

String

Definition: Solution.

Range: 0 to 4,096 characters.

Status code: 408

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 512 characters.

solution_msg

String

Definition: Solution.

Range: 0 to 4,096 characters.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Range: 8 to 36 characters.

error_msg

String

Definition: Error description.

Range: 2 to 512 characters.

solution_msg

String

Definition: Solution.

Range: 0 to 4,096 characters.

Example Requests

Query the CPU metric data for resource pools compute1 and compute2 from 2026-06-16 13:50:00 to 2026-06-16 13:51:00 with a data step of 1 minute.

GET /v2/workspaces/{workspace_id}/computes/metrics?compute_ids=02fa5e94-f44c-4ceb-9480-0e1846e6262f,13b46a70-aca3-4935-a04e-6f3dcc0a4203&start_time=1781589000&end_time=1781589060&step=60&metric_name=CPU

Example Responses

Status code: 200

{
  "data" : [ {
    "collection_time" : 1781589000,
    "values" : [ {
      "compute_name" : "compute1",
      "compute_value" : 0.5
    }, {
      "compute_name" : "compute2",
      "compute_value" : 0.5
    } ]
  } ]
}

Status code: 400

{
  "error_code" : "AIDataLake.00010151",
  "error_msg" : "Parameter value is invalid.",
  "solution_msg" : "Please input valid parameter value."
}

Status code: 401

{
  "error_code" : "APIGW.0301",
  "error_msg" : "Incorrect IAM authentication information: decrypt token fail.",
  "solution_msg" : "Check whether the IAM authentication information is correct."
}

Status code: 403

{
  "error_code" : "AIDataLake.00010150",
  "error_msg" : "The operation is not allowed.",
  "solution_msg" : "Check whether the operation is allowed in the current status."
}

Status code: 408

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred",
  "solution_msg" : "Try again later. If the problem persists, contact technical support."
}

Status code: 500

{
  "error_code" : "AIDataLake.00011001",
  "error_msg" : "Internal error.",
  "solution_msg" : "Contact technical support or try again later."
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request parameters.

401

Unauthorized.

403

Access denied.

408

Request timeout.

500

Internal server error.