Updated on 2022-09-14 GMT+08:00

Querying the Instance List

Function

This API is used to query the instances of an account by the specified conditions.

URI

GET /v2/{project_id}/instances

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

engine

No

String

Message engine. Value: reliability.

name

No

String

Instance name.

instance_id

No

String

Instance ID.

status

No

String

Instance status.

include_failure

No

String

Whether to return the number of instances that fail to be created.

If the value is true, the number of instances that failed to be created is returned. If the value is not true, the number is not returned.

exact_match_name

No

String

Whether to search for the instance that precisely matches a specified instance name.

The default value is false*, indicating that a fuzzy search is performed based on a specified instance name. If the value is true, the instance that precisely matches a specified instance name is queried.

enterprise_project_id

No

String

Enterprise project ID.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

instances

Array of ShowInstanceResp objects

Instance list.

instance_num

Integer

Number of instances.

Table 4 ShowInstanceResp

Parameter

Type

Description

name

String

Instance name.

engine

String

Message engine.

status

String

Status.

description

String

Message description.

type

String

Instance type. Value: cluster.

specification

String

Instance specification.

engine_version

String

Version.

instance_id

String

Instance ID.

charging_mode

Integer

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

vpc_id

String

VPC ID.

vpc_name

String

VPC name.

created_at

String

Time when the instance is created. The time is a Unix timestamp in millisecond.

product_id

String

Product ID.

security_group_id

String

Security group ID.

security_group_name

String

Security group name.

subnet_id

String

Subnet ID.

subnet_name

String

Subnet name.

subnet_cidr

String

Subnet route.

available_zones

Array of strings

List of AZs where there are available I/O resources.

user_id

String

User ID.

user_name

String

Username.

maintain_begin

String

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

maintain_end

String

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

enable_log_collection

Boolean

Whether log collection is enabled.

storage_space

Integer

Storage space. Unit: GB.

used_storage_space

Integer

Used message storage space. Unit: GB.

enable_publicip

Boolean

Whether public access is enabled.

publicip_id

String

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).

publicip_address

String

Public IP address.

ssl_enable

Boolean

Whether SSL is enabled.

cross_vpc_info

String

Cross-VPC access information.

storage_resource_id

String

Storage resource ID.

storage_spec_code

String

Storage specification code.

service_type

String

Service type.

storage_type

String

Storage category.

extend_times

Integer

Extension time.

ipv6_enable

Boolean

Whether IPv6 is enabled.

support_features

String

Features supported by the instance.

disk_encrypted

Boolean

Whether disk encryption is enabled.

ces_version

String

Cloud Eye version.

node_num

Integer

Node quantity.

new_spec_billing_enable

Boolean

Whether billing based on new specifications is enabled.

enable_acl

Boolean

Whether access control is enabled.

broker_num

Integer

Broker quantity.

namesrv_address

String

Metadata address.

broker_address

String

Service data address.

public_namesrv_address

String

Public network metadata address.

public_broker_address

String

Public network service data address.

tags

Array of TagEntity objects

Tag list.

total_storage_space

Integer

Total storage space.

resource_spec_code

String

Resource specifications.

Table 5 TagEntity

Parameter

Type

Description

key

String

Tag key, which can contain a maximum of 36 Unicode characters.

The key cannot be left blank or be an empty string.

It cannot contain nonprintable ASCII (0–31) characters and the following special characters: =*<>,|/

value

String

Tag value, which can contain a maximum of 43 Unicode characters.

The value cannot be left blank or be an empty string.

It cannot contain nonprintable ASCII (0–31) characters and the following special characters: =*<>,|/

Example Requests

Querying all instances

GET https://{endpoint}/v2/{project_id}/instances?engine=reliability

Example Responses

Status code: 200

Instance list queried successfully.

{
  "instances" : [ {
    "name" : "reliability-ztest",
    "engine" : "reliability",
    "status" : "RUNNING",
    "description" : "",
    "type" : "cluster",
    "specification" : "c6.4u8g.cluster * 1 broker",
    "engine_version" : "4.8.0",
    "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" : "c6.4u8g.cluster",
    "security_group_id" : "23c5977f-ff33-4b95-a73e-08d8a0bc4e6c",
    "security_group_name" : "Sys-default",
    "subnet_id" : "0a0f1fcb-f019-458d-b9e5-301867394d50",
    "available_zones" : [ "9f1c5806706d4c1fb0eb72f0a9b18c77" ],
    "user_id" : "0b01fbb53600d4671fa8c00673c71260",
    "user_name" : "",
    "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" : false,
    "ssl_enable" : false,
    "cross_vpc_info" : "{\"192.168.1.21\":{\"advertised_ip\":\"192.168.1.21\",\"broker_port\":\"-\",\"port_id\":\"fa020857-d899-497c-a5f8-8dd90ed67ff7\",\"namesrv_port\":\"8301\"},\"192.168.1.246\":{\"advertised_ip\":\"192.168.1.246\",\"broker_port\":\"10100\",\"port_id\":\"c0f0586f-a4ee-41b5-a7f1-b4e554bbf12d\",\"namesrv_port\":\"-\"},\"192.168.1.77\":{\"advertised_ip\":\"192.168.1.77\",\"broker_port\":\"10101\",\"port_id\":\"8eb1d144-4315-402f-8498-37c9a10b630c\",\"namesrv_port\":\"-\"},\"192.168.1.159\":{\"advertised_ip\":\"192.168.1.159\",\"broker_port\":\"-\",\"port_id\":\"d35b22af-a202-4329-bda4-26e1bdf2aa8e\",\"namesrv_port\":\"8300\"},\"192.168.1.14\":{\"advertised_ip\":\"192.168.1.14\",\"broker_port\":\"10102\",\"port_id\":\"5fcb50fd-3af5-4123-a455-a67f1b926026\",\"namesrv_port\":\"-\"}}",
    "storage_resource_id" : "164bdaef-2e67-4fd5-be8b-a18f91d455a2",
    "storage_spec_code" : "dms.physical.storage.ultra.v2",
    "service_type" : "advanced",
    "storage_type" : "hec",
    "extend_times" : 0,
    "ipv6_enable" : false,
    "support_features" : "kafka.crossvpc.domain.enable,feature.physerver.kafka.topic.accesspolicy,rabbitmq.plugin.management,rocketmq.acl,roma_app_enable,auto_topic_switch,feature.physerver.kafka.user.manager,enable.new.authinfo,route,kafka.config.dynamic.modify.enable,kafka.new.pod.port,feature.physerver.kafka.topic.modify,message_trace_enable,features.pod.token.access,kafka.ssl.cert.modify.enable,roma.user.manage.no.support,feature.physerver.kafka.pulbic.dynamic,features.log.collection,kafka.config.static.modify.enable",
    "disk_encrypted" : false,
    "ces_version" : "linux,v1,v2",
    "node_num" : 5,
    "new_spec_billing_enable" : true,
    "broker_num" : 1,
    "namesrv_address" : "***",
    "broker_address" : "***",
    "public_namesrv_address" : "***",
    "public_broker_address" : "***"
  } ],
  "instance_num" : 1
}

Status Codes

Status Code

Description

200

Instance list queried successfully.

Error Codes

See Error Codes.