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

Batch Deleting Topics of a Kafka Instance

Function

This API is used to delete multiple topics of a Kafka instance in batches. If some consumer groups are deleted successfully while some fail to be deleted, a success response is returned with information about consumer groups that fail to be deleted.

URI

POST /v2/{project_id}/instances/{instance_id}/topics/delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

topics

No

Array of strings

List of topics to delete.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

topics

Array of topics objects

Topic list.

Table 4 topics

Parameter

Type

Description

id

String

Topic name.

success

Boolean

Whether the topics are deleted.

Example Requests

POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics/delete

{
  "topics" : [ "topic01" ]
}

Example Responses

Status code: 200

The deletion is successful.

{
  "topics" : [ {
    "id" : "haha",
    "success" : true
  }, {
    "id" : "aabb",
    "success" : true
  } ]
}

Status Codes

Status Code

Description

200

The deletion is successful.

Error Codes

See Error Codes.