Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Admin CreatePartitions API call #1386

Merged
merged 2 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kafka/protocol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@
31: 'DeleteAcls',
32: 'DescribeConfigs',
33: 'AlterConfigs',
36: 'SaslAuthenticate',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw it was missing, but anyway where is API_KEYS used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not used atm.

37: 'CreatePartitions',
}
32 changes: 31 additions & 1 deletion kafka/protocol/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ class DescribeGroupsResponse_v1(Response):
)



class DescribeGroupsRequest_v0(Request):
API_KEY = 15
API_VERSION = 0
Expand Down Expand Up @@ -333,3 +332,34 @@ class SaslAuthenticateRequest_v0(Request):

SaslAuthenticateRequest = [SaslAuthenticateRequest_v0]
SaslAuthenticateResponse = [SaslAuthenticateResponse_v0]


class CreatePartitionsResponse_v0(Response):
API_KEY = 37
API_VERSION = 0
SCHEMA = Schema(
('throttle_time_ms', Int32),
('topic_errors', Array(
('topic', String('utf-8')),
('error_code', Int16),
('error_message', String('utf-8'))))
)


class CreatePartitionsRequest_v0(Request):
API_KEY = 37
API_VERSION = 0
RESPONSE_TYPE = CreatePartitionsResponse_v0
SCHEMA = Schema(
('topic_partitions', Array(
('topic', String('utf-8')),
('new_partitions', Schema(
('count', Int32),
('assignment', Array(Int32)))))),
('timeout', Int32),
('validate_only', Boolean)
)


CreatePartitionsRequest = [CreatePartitionsRequest_v0]
CreatePartitionsResponse = [CreatePartitionsResponse_v0]