Skip to content

Commit 5a7151a

Browse files
Added AlterConfigs and DescribeConfigs apis
1 parent 8b0b85e commit 5a7151a

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

kafka/protocol/admin.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,102 @@ class DescribeConfigsRequest_v1(Request):
406406
DescribeConfigsRequest = [DescribeConfigsRequest_v0, DescribeConfigsRequest_v1]
407407
DescribeConfigsResponse = [DescribeConfigsResponse_v0, DescribeConfigsResponse_v1]
408408

409+
class AlterConfigsRequest_v0(Request):
410+
API_KEY = 33
411+
API_VERSION = 0
412+
RESPONSE_TYPE = AlterConfigsResponse_v0
413+
SCHEMA = Schema(
414+
('resources', Array(
415+
('resource_type', Int8),
416+
('resource_name', String('utf-8')),
417+
('config_entries', Array(
418+
('config_name', String('utf-8')),
419+
('config_value', String('utf-8')))))),
420+
('validate_only', Boolean)
421+
)
422+
423+
424+
class AlterConfigsResponse_v0(Response):
425+
API_KEY = 33
426+
API_VERSION = 0
427+
SCHEMA = Schema(
428+
('throttle_time_ms', Int32),
429+
('resources', Array(
430+
('error_code', Int16),
431+
('error_message', String('utf-8')),
432+
('resource_type', Int8),
433+
('resource_name', String('utf-8'))))
434+
)
435+
436+
AlterConfigsRequest = [AlterConfigsRequest_v0]
437+
AlterConfigsResponse = [AlterConfigsResponse_v0]
438+
439+
class DescribeConfigsRequest_v0(Request):
440+
API_KEY = 32
441+
API_VERSION = 0
442+
RESPONSE_TYPE = DescribeConfigsResponse_v0
443+
SCHEMA = Schema(
444+
('resources', Array(
445+
('resource_type', Int8),
446+
('resource_name', String('utf-8')),
447+
('config_names', Array(String('utf-8')))))
448+
)
449+
450+
class DescribeConfigsRequest_v1(Request):
451+
API_KEY = 32
452+
API_VERSION = 1
453+
RESPONSE_TYPE = DescribeConfigsResponse_v1
454+
SCHEMA = Schema(
455+
('resources', Array(
456+
('resource_type', Int8),
457+
('resource_name', String('utf-8')),
458+
('config_names', Array(String('utf-8'))))),
459+
('include_synonyms', Boolean)
460+
)
461+
462+
class DescribeConfigsResponse_v0(Response):
463+
API_KEY = 32
464+
API_VERSION = 0
465+
SCHEMA = Schema(
466+
('throttle_time_ms', Int32),
467+
('resources', Array(
468+
('error_code', Int16),
469+
('error_message', String('utf-8')),
470+
('resource_type', Int8),
471+
('resource_name', String('utf-8')),
472+
('config_entries', Array(
473+
('config_names', String('utf-8')),
474+
('config_value', String('utf-8')),
475+
('read_only', Boolean),
476+
('is_default', Boolean),
477+
('is_sensitive', Boolean)))))
478+
)
479+
480+
class DescribeConfigsResponse_v1(Response):
481+
API_KEY = 32
482+
API_VERSION = 1
483+
SCHEMA = Schema(
484+
('throttle_time_ms', Int32),
485+
('resources', Array(
486+
('error_code', Int16),
487+
('error_message', String('utf-8')),
488+
('resource_type', Int8),
489+
('resource_name', String('utf-8')),
490+
('config_entries', Array(
491+
('config_names', String('utf-8')),
492+
('config_value', String('utf-8')),
493+
('read_only', Boolean),
494+
('is_default', Boolean),
495+
('is_sensitive', Boolean),
496+
('config_synonyms', Array(
497+
('config_name', String('utf-8')),
498+
('config_value', String('utf-8')),
499+
('config_source', Int8)))))))
500+
)
501+
502+
DescribeConfigsRequest = [DescribeConfigsRequest_v0, DescribeConfigsRequest_v1]
503+
DescribeConfigsResponse = [DescribeConfigsResponse_v0, DescribeConfigsResponse_v1]
504+
409505
class SaslAuthenticateResponse_v0(Request):
410506
API_KEY = 36
411507
API_VERSION = 0

0 commit comments

Comments
 (0)