All Products
Search
Document Center

Platform For AI:GetMetrics

Last Updated:Oct 16, 2025

Retrieves the metrics for an instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v2/instance/{InstanceId}/cms/metrics HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Namespace

string

No

The Cloud Monitor namespace where the metrics are stored.

acs_pai_dsw

InstanceId

string

No

The ID of the DSW instance.

dsw-328d2bbf605*****

Dimensions

string

No

The request parameters.

{"userId":"16122852825*****","jobId":"dsw-328d2bbf605*****","regionId":"cn-wulanchabu","pod":"dsw-45680-76766f8778-95gxh"}

Length

string

No

The maximum number of records to return on each page. The value cannot be greater than 1440.

10

EndTime

string

No

The end of the time range to query. The default value is the current time.

2020-11-08T16:00:00Z

Period

string

No

The time interval.

60

NextToken

string

No

The pagination token.

15761485350009dd70bb64cff1f0fff750b08ffff073be5fb1e785e2b020f1a949d5ea14aea7fed82f01dd8****

MetricName

string

No

The name of the metric. For more information, see Metric Names.

INSTANCE_SPEC_MEMORY_SWAP

StartTime

string

No

The beginning of the time range to query. The default value is one hour before the current time.

2020-11-08T15:00:00Z

Response elements

Element

Type

Description

Example

object

The response schema.

NextToken

string

The pagination token.

15761485350009dd70bb64cff1f0fff750b08ffff073be5fb1e785e2b020f1a949d5ea14aea7fed82f01dd8****

Success

boolean

Indicates whether the request was successful.

true

Datapoints

string

The data points of the metric.

[{'timestamp': 1740452220000, 'jobId': 'dsw-94ed9f9********', 'pod': 'dsw-871***-764fdf******', 'regionId': 'cn-hangzhou', 'userId': '1042612********', 'workspaceId': '1445***', 'Value': 0.0}]

Code

string

The status code of the request.

200

Message

string

The message returned for the request.

Succeed

Period

string

The time interval.

60

RequestId

string

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Success response

JSON format

{
  "NextToken": "15761485350009dd70bb64cff1f0fff750b08ffff073be5fb1e785e2b020f1a949d5ea14aea7fed82f01dd8****",
  "Success": true,
  "Datapoints": "[{'timestamp': 1740452220000, 'jobId': 'dsw-94ed9f9********', 'pod': 'dsw-871***-764fdf******', 'regionId': 'cn-hangzhou', 'userId': '1042612********', 'workspaceId': '1445***', 'Value': 0.0}]",
  "Code": "200",
  "Message": "Succeed",
  "Period": "60",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.