Skip to content

Commit f1f6908

Browse files
alexefjeffwidman
authored andcommitted
Add Admin CreatePartitions API call
1 parent 60b22b1 commit f1f6908

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

kafka/protocol/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@
4242
31: 'DeleteAcls',
4343
32: 'DescribeConfigs',
4444
33: 'AlterConfigs',
45+
36: 'SaslAuthenticate',
46+
37: 'CreatePartitions',
4547
}

kafka/protocol/admin.py

+30-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ class DescribeGroupsResponse_v1(Response):
256256
)
257257

258258

259-
260259
class DescribeGroupsRequest_v0(Request):
261260
API_KEY = 15
262261
API_VERSION = 0
@@ -333,3 +332,33 @@ class SaslAuthenticateRequest_v0(Request):
333332

334333
SaslAuthenticateRequest = [SaslAuthenticateRequest_v0]
335334
SaslAuthenticateResponse = [SaslAuthenticateResponse_v0]
335+
336+
337+
class CreatePartitionsResponse_v0(Response):
338+
API_KEY = 37
339+
API_VERSION = 0
340+
SCHEMA = Schema(
341+
('topic_error_codes', Array(
342+
('topic', String('utf-8')),
343+
('error_code', Int16),
344+
('error_message', String('utf-8'))))
345+
)
346+
347+
348+
class CreatePartitionsRequest_v0(Request):
349+
API_KEY = 37
350+
API_VERSION = 0
351+
RESPONSE_TYPE = CreatePartitionsResponse_v0
352+
SCHEMA = Schema(
353+
('topic_partitions', Array(
354+
('topic', String('utf-8')),
355+
('new_partitions', Schema(
356+
('count', Int32),
357+
('assignment', Array(Int32)))))),
358+
('timeout', Int32),
359+
('validate_only', Boolean)
360+
)
361+
362+
363+
CreatePartitionsRequest = [CreatePartitionsRequest_v0]
364+
CreatePartitionsResponse = [CreatePartitionsResponse_v0]

0 commit comments

Comments
 (0)