Updated on 2025-09-19 GMT+08:00

Querying the Metrics of a Cluster

Function

This API is used to query metrics of a cluster.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/clusters/{cluster_id}/dms/metrics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

cluster_id

Yes

String

Definition

Cluster ID. For details about how to obtain the value, see Obtaining the Cluster ID.

Constraints

The value must be a valid DWS cluster ID.

Range

It is a 36-digit UUID.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Definition

Page offset, which starts from 0 (page number minus 1).

Constraints

N/A

Range

Greater than or equal to 0

Default Value

0

limit

Yes

Integer

Definition

Size of a single page.

Constraints

N/A

Range

Greater than 0 and less than or equal to 1000

Default Value

No limit.

order_by

No

String

Definition

Sorting field. The value is fixed.

Constraints

N/A

Range

create_time

Default Value

N/A

sort_by

No

String

Definition

Whether the order is ascending or descending. The value is fixed.

Constraints

N/A

Range

asc

desc

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

Integer

Definition

Response code.

Range

N/A

msg

String

Definition

Response information.

Range

N/A

data

Array of ClusterMetric objects

Definition

Metric list.

Range

N/A

count

Long

Definition

Total number of rows in the list.

Range

N/A

Table 4 ClusterMetric

Parameter

Type

Description

scope

String

Definition

Metric name.

Range

N/A

fields

Array of SimpleFieldDto objects

Definition

Columns of the metric table.

Range

N/A

metric_name

String

Definition

Scope.

Range

N/A

collect_rate

Integer

Definition

Collection rate.

Range

N/A

collect_range

Array of strings

Definition

Collection time range.

Range

N/A

create_time

String

Definition

Creation time.

Range

N/A

Table 5 SimpleFieldDto

Parameter

Type

Description

column_name

String

Definition

Column name in the metric table.

Range

N/A

column_type

String

Definition

Column type in the metric table.

Range

N/A

Example Requests

https://{Endpoint}/v1/{project_id}/clusters/{cluster_id}/dms/metrics?limit=1&offset=0&order_by=create_time&sort_by=desc

Example Responses

Status code: 200

Query succeeded.

{
  "code" : 0,
  "msg" : "OK",
  "data" : [ {
    "scope" : "CN,ANY",
    "fields" : [ {
      "column_name" : "db_name",
      "column_type" : "text"
    }, {
      "column_name" : "schema_name",
      "column_type" : "text"
    }, {
      "column_name" : "table_name",
      "column_type" : "text"
    }, {
      "column_name" : "table_owner",
      "column_type" : "text"
    }, {
      "column_name" : "table_size",
      "column_type" : "bigint"
    }, {
      "column_name" : "dirty_page_rate",
      "column_type" : "double precision"
    } ],
    "metric_name" : "TableDirtyPageRate",
    "collect_rate" : 7200,
    "collect_range" : [ ],
    "create_time" : "1701915436000"
  } ],
  "count" : 1
}

Status Codes

Status Code

Description

200

Query succeeded.

400

Request error.

401

Authentication failed.

403

No operation permissions.

500

Internal server error.

503

Service unavailable.