summaryrefslogtreecommitdiff
path: root/kafka/protocol/admin.py
diff options
context:
space:
mode:
authorSwen Wenzel <5111028+swenzel@users.noreply.github.com>2020-09-17 18:17:35 +0200
committerGitHub <noreply@github.com>2020-09-17 09:17:35 -0700
commit16a0b3155fdeebe80295fcfb0f32d75af74dcb1a (patch)
treedf9b10de0ee8f9b40f28a74276182c096e7bbabf /kafka/protocol/admin.py
parente485a6ee2a1f05f2333e22b0fbdbafb12badaf3f (diff)
downloadkafka-python-16a0b3155fdeebe80295fcfb0f32d75af74dcb1a.tar.gz
Feature: delete consumergroups (#2040)
* Add consumergroup related errors * Add DeleteGroups to protocol.admin * Implement delete_groups feature on KafkaAdminClient
Diffstat (limited to 'kafka/protocol/admin.py')
-rw-r--r--kafka/protocol/admin.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/kafka/protocol/admin.py b/kafka/protocol/admin.py
index af88ea4..f3b691a 100644
--- a/kafka/protocol/admin.py
+++ b/kafka/protocol/admin.py
@@ -882,3 +882,44 @@ CreatePartitionsResponse = [
CreatePartitionsResponse_v0, CreatePartitionsResponse_v1,
]
+
+class DeleteGroupsResponse_v0(Response):
+ API_KEY = 42
+ API_VERSION = 0
+ SCHEMA = Schema(
+ ("throttle_time_ms", Int32),
+ ("results", Array(
+ ("group_id", String("utf-8")),
+ ("error_code", Int16)))
+ )
+
+
+class DeleteGroupsResponse_v1(Response):
+ API_KEY = 42
+ API_VERSION = 1
+ SCHEMA = DeleteGroupsResponse_v0.SCHEMA
+
+
+class DeleteGroupsRequest_v0(Request):
+ API_KEY = 42
+ API_VERSION = 0
+ RESPONSE_TYPE = DeleteGroupsResponse_v0
+ SCHEMA = Schema(
+ ("groups_names", Array(String("utf-8")))
+ )
+
+
+class DeleteGroupsRequest_v1(Request):
+ API_KEY = 42
+ API_VERSION = 1
+ RESPONSE_TYPE = DeleteGroupsResponse_v1
+ SCHEMA = DeleteGroupsRequest_v0.SCHEMA
+
+
+DeleteGroupsRequest = [
+ DeleteGroupsRequest_v0, DeleteGroupsRequest_v1
+]
+
+DeleteGroupsResponse = [
+ DeleteGroupsResponse_v0, DeleteGroupsResponse_v1
+]