Updated on 2026-08-19 GMT+08:00

Querying Instance Monitoring Dimensions

Function

This API is used to query instance monitoring dimensions.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/instances/{instance_id}/ces-hierarchy

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID. You can call the API for querying all instances to obtain the instance ID. The instance ID is in the response body.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

dimensions

Array of dimensions objects

Definition

Monitoring dimensions.

Range

N/A

instance_ids

Array of instance_ids objects

Definition

Instance information.

Range

N/A

nodes

Array of nodes objects

Definition

Node information.

Range

N/A

topics

Array of topics objects

Definition

Topic information.

Range

N/A

dlq

Array of dlq objects

Definition

Dead letter queue.

Range

N/A

groups

Array of groups objects

Definition

Consumer group information.

Range

N/A

Table 3 dimensions

Parameter

Type

Description

name

String

Definition

Monitoring dimension name.

Range

N/A

metrics

Array of strings

Definition

Metric name.

Range

N/A

key_name

Array of strings

Definition

Key used for monitoring query.

Range

N/A

dim_router

Array of strings

Definition

Monitoring dimension route.

Range

N/A

children

Array of children objects

Definition

List of secondary dimensions.

Range

N/A

Table 4 children

Parameter

Type

Description

name

String

Definition

Secondary dimension name.

Range

N/A

metrics

Array of strings

Definition

List of monitoring metric names.

Range

N/A

key_name

Array of strings

Definition

Key used for monitoring query.

Range

N/A

dim_router

Array of strings

Definition

Monitoring dimension route.

Range

N/A

Table 5 instance_ids

Parameter

Type

Description

name

String

Definition

Instance ID.

Range

N/A

Table 6 nodes

Parameter

Type

Description

name

String

Definition

Node name.

Range

N/A

available_zone

String

Definition

AZ.

Range

N/A

Table 7 topics

Parameter

Type

Description

name

String

Definition

Topic name.

Range

N/A

Table 8 dlq

Parameter

Type

Description

name

String

Definition

Dead letter queue name.

Range

N/A

Table 9 groups

Parameter

Type

Description

name

String

Definition

Consumer group name.

Range

N/A

topics

Array of topics objects

Definition

Topic subscription information.

Range

N/A

Table 10 topics

Parameter

Type

Description

name

String

Definition

Topic name.

Range

N/A

Example Requests

GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/ces-hierarchy

Example Responses

Status code: 200

Queried.

{
  "dimensions" : [ {
    "name" : "reliablemq_instance_id",
    "metrics" : [ "instance_produce_msg", "instance_consume_msg" ],
    "key_name" : [ "instance_ids" ],
    "dim_router" : [ "reliablemq_instance_id" ]
  }, {
    "name" : "reliablemq_broker",
    "metrics" : [ "broker_produce_msg", "broker_consume_msg", "broker_produce_rate", "broker_consume_rate", "broker_total_bytes_in_rate", "broker_total_bytes_out_rate", "broker_cpu_core_load", "broker_disk_usage", "broker_memory_usage" ],
    "key_name" : [ "nodes" ],
    "dim_router" : [ "reliablemq_instance_id", "reliablemq_broker" ]
  }, {
    "name" : "reliablemq_topics",
    "metrics" : [ "topic_produce_msg", "topic_consume_msg", "topic_produce_rate", "topic_consume_rate" ],
    "key_name" : [ "topics" ],
    "dim_router" : [ "reliablemq_instance_id", "reliablemq_topics" ]
  }, {
    "name" : "reliablemq_groups",
    "metrics" : [ "group_consume_msg", "group_accumulation" ],
    "key_name" : [ "groups" ],
    "dim_router" : [ "reliablemq_instance_id", "reliablemq_groups" ],
    "children" : [ {
      "name" : "reliablemq_groups_topics",
      "metrics" : [ "group_topic_consume_msg", "group_topic_consume_rate", "group_topic_accumulation" ],
      "key_name" : [ "groups", "topics" ],
      "dim_router" : [ "reliablemq_instance_id", "reliablemq_groups", "reliablemq_groups_topics" ]
    } ]
  }, {
    "name" : "reliablemq_dlq_topics",
    "metrics" : [ "dlq_accumulation" ],
    "key_name" : [ "dlq" ],
    "dim_router" : [ "reliablemq_instance_id", "reliablemq_dlq_topics" ]
  } ],
  "instance_ids" : [ {
    "name" : "af82f7a9-5636-4898-85e4-200fe0fab361"
  } ],
  "nodes" : [ {
    "name" : "broker-0-172-16-0-207",
    "available_zone" : "region_ida"
  } ],
  "topics" : [ {
    "name" : "dingshi"
  }, {
    "name" : "lala"
  }, {
    "name" : "shunxu"
  } ],
  "dlq" : [ {
    "name" : "DLQ_group-1"
  }, {
    "name" : "DLQ_group-1000"
  }, {
    "name" : "DLQ_group-2"
  }, {
    "name" : "DLQ_group-3"
  }, {
    "name" : "DLQ_group-4"
  }, {
    "name" : "DLQ_group-5"
  }, {
    "name" : "DLQ_group-6"
  }, {
    "name" : "DLQ_group-7"
  }, {
    "name" : "DLQ_group-8"
  }, {
    "name" : "DLQ_group-9"
  }, {
    "name" : "DLQ_group-dingshi"
  }, {
    "name" : "DLQ_group-shunxu"
  }, {
    "name" : "DLQ_group101010"
  } ],
  "groups" : [ {
    "name" : "group-shunxu",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-7",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-dingshi",
    "topics" : [ {
      "name" : "dingshi"
    } ]
  }, {
    "name" : "group-6",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-9",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-8",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-3",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-2",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-5",
    "topics" : [ {
      "name" : "dingshi"
    }, {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-4",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group101010",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-1000",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  }, {
    "name" : "group-1",
    "topics" : [ {
      "name" : "shunxu"
    } ]
  } ]
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.rocketmq.v2.region.RocketMQRegion;
import com.huaweicloud.sdk.rocketmq.v2.*;
import com.huaweicloud.sdk.rocketmq.v2.model.*;


public class ShowCesHierarchySolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        RocketMQClient client = RocketMQClient.newBuilder()
                .withCredential(auth)
                .withRegion(RocketMQRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowCesHierarchyRequest request = new ShowCesHierarchyRequest();
        request.withInstanceId("{instance_id}");
        try {
            ShowCesHierarchyResponse response = client.showCesHierarchy(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkrocketmq.v2.region.rocketmq_region import RocketMQRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkrocketmq.v2 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = RocketMQClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(RocketMQRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowCesHierarchyRequest()
        request.instance_id = "{instance_id}"
        response = client.show_ces_hierarchy(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    rocketmq "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rocketmq/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rocketmq/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/rocketmq/v2/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth, err := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        SafeBuild()

    if err != nil {
        fmt.Println(err)
        return
    }

    hcClient, err := rocketmq.RocketMQClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()


    if err != nil {
        fmt.Println(err)
        return
    }

    client := rocketmq.NewRocketMQClient(hcClient)

    request := &model.ShowCesHierarchyRequest{}
	request.InstanceId = "{instance_id}"
	response, err := client.ShowCesHierarchy(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Queried.

Error Codes

See Error Codes.