Listing All Instances

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. For details about how to obtain it, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

engine

Yes

String

Message engine. Value: kafka.

name

No

String

Instance name.

instance_id

No

String

Instance ID.

status

No

String

Instance status.

For details, see Instance Status.

include_failure

No

String

Indicates 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 false, 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.

offset

No

String

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

limit

No

String

Maximum number of instances returned in the current query. The default value is 10. The value ranges from 1 to 50.

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.

engine_version

String

Version.

description

String

Instance description

specification

String

Instance specifications.

storage_space

Integer

Message storage space in GB.

partition_num

String

Number of partitions in a Kafka instance.

used_storage_space

Integer

Used message storage space in GB.

connect_address

String

IP address of an instance.

port

Integer

Port of an instance.

status

String

Instance status. For details, see Instance Status.

instance_id

String

Instance ID.

resource_spec_code

String

Resource specifications.

  • dms.instance.kafka.cluster.c3.mini: Kafka instance with 100 MB/s bandwidth

  • dms.instance.kafka.cluster.c3.small.2: Kafka instance with 300 MB/s bandwidth

  • dms.instance.kafka.cluster.c3.middle.2: Kafka instance with 600 MB/s bandwidth

  • dms.instance.kafka.cluster.c3.high.2: Kafka instance with 1200 MB/s bandwidth

charging_mode

Integer

Billing mode. 1: pay-per-use.

vpc_id

String

VPC ID.

vpc_name

String

VPC name.

created_at

String

Time when the instance was created.

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.

subnet_name

String

Subnet name.

subnet_cidr

String

Subnet CIDR block.

user_id

String

User ID.

user_name

String

Username.

access_user

String

Username for accessing the instance.

maintain_begin

String

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

maintain_end

String

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

enable_publicip

Boolean

Whether public access is enabled for the instance.

  • true: enabled

  • false: disabled

ssl_enable

Boolean

Whether security authentication is enabled.

  • true: enable

  • false: disabled

broker_ssl_enable

Boolean

Indicates whether to enable encrypted replica transmission among brokers.

  • true: enable

  • false: disable

kafka_security_protocol

String

Security protocol to use after SASL is enabled.

  • SASL_SSL: Data is encrypted with SSL certificates for high-security transmission.

  • SASL_PLAINTEXT: Data is transmitted in plaintext with username and password authentication. This protocol uses the SCRAM-SHA-512 mechanism and delivers high performance.

sasl_enabled_mechanisms

Array of strings

Authentication mechanism used after SASL is enabled.

  • PLAIN: simple username and password verification.

  • SCRAM-SHA-512: user credential verification, which is more secure than PLAIN.

ssl_two_way_enable

Boolean

Indicates whether to enable two-way authentication.

cert_replaced

Boolean

Whether the certificate can be replaced.

enterprise_project_id

String

Enterprise project ID.

type

String

Instance type. The value can be cluster.

product_id

String

Product ID.

security_group_id

String

Security group ID.

security_group_name

String

Security group name.

subnet_id

String

Subnet ID.

available_zones

Array of strings

AZ to which the instance brokers belong. The AZ ID is returned.

available_zone_names

Array of strings

Name of the AZ to which the instance node belongs. The AZ name is returned.

total_storage_space

Integer

Message storage space in GB.

public_connect_address

String

Instance public access address. This parameter is available only when public access is enabled for the instance.

storage_resource_id

String

Storage resource ID.

storage_spec_code

String

I/O specifications.

service_type

String

Service type.

storage_type

String

Storage class.

retention_policy

String

Message retention policy.

kafka_public_status

String

Whether public access is enabled for Kafka.

public_bandwidth

Integer

Public network access bandwidth.

new_auth_cert

Boolean

Indicates whether to enable a new certificate.

cross_vpc_info

String

Cross-VPC access information.

connector_enable

Boolean

Whether dumping is enabled. Dumping is not supported for the new specification type.

connector_node_num

Integer

Number of connectors.

rest_connect_address

String

Kafka REST connection address.

pod_connect_address

String

Connection address on the tenant side.

disk_encrypted

Boolean

Whether disk encryption is enabled.

disk_encrypted_key

String

Disk encryption key. If disk encryption is not enabled, this parameter is left blank.

kafka_private_connect_address

String

Private connection address of a Kafka instance.

ces_version

String

Cloud Eye version.

public_access_enabled

String

Time when public access was enabled for an instance.

Value range:

  • true: enabled

  • actived: disabled

  • closed: disabled

  • false: disabled

node_num

Integer

Node quantity.

enable_acl

Boolean

Indicates whether access control is enabled.

new_spec_billing_enable

Boolean

Whether billing based on new specifications is enabled.

broker_num

Integer

Broker quantity.

tags

Array of TagEntity objects

Tag list.

dr_enable

Boolean

Indicates whether DR is enabled.

Table 5 TagEntity

Parameter

Type

Description

key

String

Tag key.

  • Must be specified.

  • Must be unique for the same instance.

  • Can contain 1 to 128 characters.

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

  • Cannot start or end with a space.

value

String

Tag value.

  • Can contain 0 to 255 characters.

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

  • Cannot start or end with a space.

Example Requests

Querying the instance list

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

Example Responses

Status code: 200

Instance list queried.

  • {
      "instances" : [ {
        "name" : "kafka-2085975099",
        "engine" : "kafka",
        "port" : 9092,
        "status" : "RUNNING",
        "type" : "cluster",
        "specification" : "100MB",
        "engine_version" : "1.1.0",
        "connect_address" : "192.168.0.100,192.168.0.61,192.168.0.72",
        "instance_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "resource_spec_code" : "dms.instance.kafka.cluster.c3.mini",
        "charging_mode" : 1,
        "vpc_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "vpc_name" : "dms-test",
        "created_at" : "1585618587087",
        "product_id" : "00300-30308-0--0",
        "security_group_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "security_group_name" : "Sys-default",
        "subnet_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "available_zones" : [ "38b0f7a602344246bcb0da47b5d548e7" ],
        "available_zone_names" : [ "AZ1" ],
        "user_id" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "user_name" : "paas_dms",
        "access_user" : "root",
        "maintain_begin" : "02:00:00",
        "maintain_end" : "06:00:00",
        "enable_log_collection" : false,
        "new_auth_cert" : false,
        "storage_space" : 492,
        "total_storage_space" : 600,
        "used_storage_space" : 25,
        "partition_num" : "300",
        "enable_publicip" : false,
        "ssl_enable" : true,
        "broker_ssl_enable" : false,
        "cert_replaced" : false,
        "kafka_security_protocol" : "SASL_SSL",
        "management_connect_address" : "https://192.168.0.100:9999",
        "cross_vpc_info" : "{\"192.168.0.61\":{\"advertised_ip\":\"192.168.0.61\",\"port\":9011,\"port_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"},\"192.168.0.72\":{\"advertised_ip\":\"192.168.0.72\",\"port\":9011,\"port_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"},\"192.168.0.100\":{\"advertised_ip\":\"192.168.0.100\",\"port\":9011,\"port_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"}}",
        "storage_resource_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "storage_spec_code" : "dms.physical.storage.ultra",
        "service_type" : "advanced",
        "storage_type" : "hec",
        "enterprise_project_id" : "0",
        "retention_policy" : "produce_reject",
        "ipv6_enable" : false,
        "ipv6_connect_addresses" : [ ],
        "rest_enable" : false,
        "rest_connect_address" : "",
        "kafka_public_status" : "closed",
        "public_bandwidth" : 0,
        "trace_enable" : false,
        "agent_enable" : false,
        "pod_connect_address" : "100.86.75.15:9080,100.86.142.77:9080,100.86.250.167:9080",
        "disk_encrypted" : false,
        "kafka_private_connect_address" : "192.168.0.61:9092,192.168.0.100:9092,192.168.0.72:9092",
        "new_spec_billing_enable" : false,
        "ces_version" : "linux"
      } ],
      "instance_num" : 1
    }
    

Status Codes

Status Code

Description

200

Instance list queried.

Error Codes

See Error Codes.