Updated on 2025-08-13 GMT+08:00

Querying an Instance

Function

This API is used to query the details about a specified instance.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/instances/{instance_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

instance_id

Yes

String

Parameter description:

Instance ID. To obtain it, log in to the RocketMQ console and find the instance ID on the RocketMQ instance details page.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

name

String

Parameter description:

Instance name.

Value range:

N/A

engine

String

Parameter description:

Message engine.

Value range:

N/A

status

String

Parameter description:

Status.

Value range:

N/A

description

String

Parameter description:

Message description.

Value range:

N/A

type

String

Parameter description:

Instance type.

Value range:

  • single: single-node

  • cluster: cluster

specification

String

Parameter description:

Instance specification.

Value range:

N/A

engine_version

String

Parameter description:

Instance version.

Value range:

N/A

instance_id

String

Parameter description:

Instance ID.

Value range:

N/A

charging_mode

Integer

Parameter description:

Billing mode.

Value range:

1: pay-per-use; 0: yearly/monthly.

vpc_id

String

Parameter description:

VPC ID.

Value range:

N/A

vpc_name

String

Parameter description:

VPC name.

Value range:

N/A

created_at

String

Parameter description:

Time when creation is complete.

The time is in the format of timestamp, that is, the offset milliseconds from 1970-01-01 00:00:00 UTC to the specified time.

Value range:

N/A

product_id

String

Parameter description:

Product ID.

Value range:

N/A

security_group_id

String

Parameter description:

Security group ID.

Value range:

N/A

security_group_name

String

Parameter description:

Security group name.

Value range:

N/A

subnet_id

String

Parameter description:

Subnet ID.

Value range:

N/A

subnet_name

String

Parameter description:

Subnet name.

Value range:

N/A

subnet_cidr

String

Parameter description:

Subnet route. This field is displayed only for RocketMQ 5.x.

Value range:

N/A

available_zones

Array of strings

Parameter description:

List of AZ IDs.

Value range:

N/A

available_zone_names

Array of strings

Parameter description:

List of AZ names.

user_id

String

Parameter description:

User ID.

Value range:

N/A

user_name

String

Parameter description:

Username.

Value range:

N/A

maintain_begin

String

Parameter description:

Time at which the maintenance window starts. The format is HH:mm:ss.

Value range:

N/A

maintain_end

String

Parameter description:

Time at which the maintenance window ends. The format is HH:mm:ss.

Value range:

N/A

enable_log_collection

Boolean

Parameter description:

Whether log collection is enabled.

Value range:

  • true: yes

  • false: no

storage_space

Integer

Parameter description:

Storage space, in GB.

Value range:

N/A

used_storage_space

Integer

Parameter description:

Used message storage space, in GB.

Value range:

N/A

enable_publicip

Boolean

Parameter description:

Whether to enable public access.

Value range:

  • true: yes

  • false: no

publicip_id

String

Parameter description:

ID of the EIP bound to the instance.

Use commas (,) to separate multiple EIP IDs.

This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true).

Value range:

N/A

publicip_address

String

Parameter description:

Public IP address.

Value range:

N/A

ssl_enable

Boolean

Parameter description:

Whether SSL is enabled.

Value range:

  • true: yes

  • false: no

cross_vpc_info

String

Parameter description:

Cross-VPC access information.

Value range:

N/A

storage_resource_id

String

Parameter description:

Storage resource ID.

Value range:

N/A

storage_spec_code

String

Parameter description:

Storage specification code.

Value range:

N/A

service_type

String

Parameter description:

Service type.

Value range:

N/A

storage_type

String

Parameter description:

Storage type.

Value range:

N/A

extend_times

Long

Parameter description:

Extension time.

Value range:

N/A

ipv6_enable

Boolean

Parameter description:

Whether IPv6 is enabled.

Value range:

  • true: yes

  • false: no

support_features

String

Parameter description:

Features supported by the instance.

Value range:

N/A

disk_encrypted

Boolean

Parameter description:

Whether disk encryption is enabled.

Value range:

  • true: yes

  • false: no

ces_version

String

Parameter description:

Cloud Eye version.

Value range:

N/A

node_num

Integer

Parameter description:

Number of nodes.

Value range:

N/A

new_spec_billing_enable

Boolean

Parameter description:

Whether billing based on new specifications is enabled.

Value range:

  • true: yes

  • false: no

enable_acl

Boolean

Parameter description:

Whether access control is enabled.

Value range:

  • true: yes

  • false: no

broker_num

Integer

Parameter description:

Number of brokers (displayed only for RocketMQ 4.8.0).

Value range:

N/A

dns_enable

Boolean

Parameter description:

Whether to enable domain name access to an instance.

Value range:

  • true: yes

  • false: no

namesrv_address

String

Parameter description:

Metadata address.

Value range:

N/A

namesrv_domain_name

String

Parameter description:

Metadata domain name.

Value range:

N/A

broker_address

String

Parameter description:

Service data address.

Value range:

N/A

public_namesrv_address

String

Parameter description:

Public network metadata address.

Value range:

N/A

public_namesrv_domain_name

String

Parameter description:

Public metadata domain name.

Value range:

N/A

public_broker_address

String

Parameter description:

Public network service data address.

Value range:

N/A

grpc_address

String

Parameter description:

gRPC connection address (displayed only for RocketMQ 5.x).

Value range:

N/A

grpc_domain_name

String

Parameter description:

gRPC connection domain name (displayed only for RocketMQ 5.x).

Value range:

N/A

public_grpc_address

String

Parameter description:

Public gRPC connection address (displayed only for RocketMQ 5.x).

Value range:

N/A

public_grpc_domain_name

String

Parameter description:

Public gRPC domain name (displayed only for RocketMQ 5.x).

Value range:

N/A

enterprise_project_id

String

Parameter description:

Enterprise project ID.

Value range:

N/A

tags

Array of TagEntity objects

Parameter description:

Tag list.

Value range:

N/A

total_storage_space

Integer

Parameter description:

Total storage space.

Value range:

N/A

resource_spec_code

String

Parameter description:

Resource flavor.

Value range:

N/A

produce_portion

Integer

Parameter description:

Production TPS proportion.

Value range:

N/A

consume_portion

Integer

Parameter description:

Consumption TPS proportion.

Value range:

N/A

dr_enable

Boolean

Parameter description:

Whether DR is enabled.

Value range:

N/A

config_ssl_need_restart_process

Boolean

Parameter description:

Whether a restart is required to configure SSL.

Value range:

N/A

tls_mode

String

Parameter description:

Security protocol used by the instance.

Value range:

N/A

Table 3 TagEntity

Parameter

Type

Description

key

String

Definition:

Tag key.

Constraints:

  • Cannot be left blank.

  • Must be unique for the same instance.

  • Can contain 1 to 128 characters.

  • Can contain letters, digits, spaces, and special characters _.:=+-@

  • Cannot start with sys

  • Cannot start or end with a space.

Range:

N/A

Default Value:

N/A

value

String

Definition:

Tag value.

Constraints:

  • Can contain 0 to 255 characters.

  • Can contain letters, digits, spaces, and special characters _.:=+-@

  • Cannot start or end with a space.

Range:

N/A

Default Value:

N/A

Example Requests

Querying details of a specified instance

GET https://{endpoint}/v2/{project_id}/instances/{instance_id}

Example Responses

Status code: 200

Instance queried successfully.

{
  "name" : "reliability-test",
  "engine" : "reliability",
  "status" : "RUNNING",
  "description" : "",
  "type" : "single.basic",
  "specification" : "rocketmq.b1.large.1, 500 tps",
  "engine_version" : "5.x",
  "instance_id" : "68fdc9a8-805e-439d-8dd9-25adc1c58bf6",
  "resource_spec_code" : "",
  "charging_mode" : 1,
  "vpc_id" : "3db8490c-4d6d-4d8f-8d3f-047b0de4c5cf",
  "vpc_name" : "vpc-1101840",
  "created_at" : "1636699753874",
  "product_id" : "rocketmq.b1.large.1",
  "security_group_id" : "23c5977f-ff33-4b95-a73e-08d8a0bc4e6c",
  "security_group_name" : "security_group_test",
  "subnet_id" : "0a0f1fcb-f019-458d-b9e5-301867394d50",
  "subnet_name" : "subnet-test",
  "subnet_cidr" : "192.168.64.0/18",
  "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ],
  "available_zone_names" : [ "AZ3" ],
  "user_id" : "0b01fbb53600d4671fa8c00673c71260",
  "user_name" : "user_test",
  "maintain_begin" : "02:00:00",
  "maintain_end" : "06:00:00",
  "enable_log_collection" : false,
  "storage_space" : 558,
  "total_storage_space" : 600,
  "used_storage_space" : 28,
  "enable_publicip" : true,
  "publicip_id" : "83924171-7014-48f0-a6b2-c714e7a090dd",
  "publicip_address" : "***",
  "ssl_enable" : false,
  "cross_vpc_info" : "{\"192.168.93.114\":{\"advertised_ip\":\"192.168.93.114\",\"broker_port\":\"10100\",\"port_id\":\"b3de3981-1f73-4e6f-b35a-78833b783364\",\"namesrv_port\":\"8300\"}}",
  "storage_resource_id" : "164bdaef-2e67-4fd5-be8b-a18f91d455a2",
  "storage_spec_code" : "dms.physical.storage.ultra.v2",
  "service_type" : "advanced",
  "storage_type" : "hec",
  "enterprise_project_id" : "0",
  "extend_times" : 0,
  "ipv6_enable" : false,
  "support_features" : "kafka.crossvpc.domain.enable,auto.create.topics.enable,rabbitmq.plugin.management,support.permissive.mode,auto_topic_switch,feature.physerver.kafka.user.manager,kafka.ssl.2way.modify.enable,kafka.new.pod.port,message_trace_enable,features.pod.token.access,log.enable,features.log.collection,max.connections,rabbitmq.manage.support,replica_port_standalone,feature.physerver.kafka.topic.accesspolicy,enable.kafka.quota.monitor,rocketmq.acl,roma_app_enable,support.kafka.producer.ip,enable.new.authinfo,enable.kafka.quota,rabbitmq_run_log_enable,max.ssl.connections,route,message_trace_v2_enable,kafka.config.dynamic.modify.enable,feature.physerver.kafka.topic.modify,enable.topic.quota,kafka.ssl.cert.modify.enable,roma.user.manage.no.support,auto.create.groups.enable,feature.physerver.kafka.pulbic.dynamic,kafka.config.static.modify.enable",
  "disk_encrypted" : false,
  "ces_version" : "linux,v1,v2,v3,v4",
  "new_spec_billing_enable" : true,
  "enable_acl" : false,
  "namesrv_address" : "192.168.93.114:8100",
  "broker_address" : "192.168.64.0/18:10100",
  "public_namesrv_address" : "100.85.116.211:8200",
  "public_broker_address" : "100.85.116.211:10101",
  "grpc_address" : "192.168.93.114:8080",
  "public_grpc_address" : "100.85.116.211:8081"
}

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 ShowInstanceSolution {

    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();
        ShowInstanceRequest request = new ShowInstanceRequest();
        request.withInstanceId("{instance_id}");
        try {
            ShowInstanceResponse response = client.showInstance(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 = ShowInstanceRequest()
        request.instance_id = "{instance_id}"
        response = client.show_instance(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
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 := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := rocketmq.NewRocketMQClient(
        rocketmq.RocketMQClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ShowInstanceRequest{}
	request.InstanceId = "{instance_id}"
	response, err := client.ShowInstance(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

Instance queried successfully.

Error Codes

See Error Codes.