Updated on 2025-12-31 GMT+08:00

Querying Kafka Cluster Information

Function

This API is used to query Kafka cluster information.

Calling Method

For details, see Calling APIs.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

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

project_id

Yes

String

Definition

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

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

cluster

cluster object

Definition

Cluster information.

Table 3 cluster

Parameter

Type

Description

brokers

Array of brokers objects

Definition

Broker details.

Table 4 brokers

Parameter

Type

Description

health

Boolean

Definition

Whether the cluster is healthy.

Range

  • true: Yes

  • false: No

host

String

Definition

Host address.

Range

N/A

port

Integer

Definition

Port.

Range

N/A

broker_id

String

Definition

Node ID.

Range

N/A

Example Requests

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

Example Responses

Status code: 200

Kafka cluster information queried.

{
  "cluster" : {
    "brokers" : [ {
      "host" : "192.168.0.1",
      "port" : 9092,
      "broker_id" : 0,
      "health" : true
    }, {
      "host" : "192.168.0.2",
      "port" : 9092,
      "broker_id" : 1,
      "health" : true
    }, {
      "host" : "192.168.0.3",
      "port" : 9092,
      "broker_id" : 2,
      "health" : true
    } ]
  }
}

Status Codes

Status Code

Description

200

Kafka cluster information queried.

Error Codes

See Error Codes.