diff --git a/kafka/admin/client.py b/kafka/admin/client.py index eb2520b92..b06e4451c 100644 --- a/kafka/admin/client.py +++ b/kafka/admin/client.py @@ -802,7 +802,7 @@ def describe_configs(self, config_resources, include_synonyms=False): DescribeConfigsRequest[version](resources=topic_resources) )) - elif version == 1: + elif version <= 2: if len(broker_resources) > 0: for broker_resource in broker_resources: try: diff --git a/kafka/protocol/admin.py b/kafka/protocol/admin.py index 5bc7ad6f2..1cc312cc2 100644 --- a/kafka/protocol/admin.py +++ b/kafka/protocol/admin.py @@ -708,6 +708,28 @@ class DescribeConfigsResponse_v1(Response): ('config_source', Int8))))))) ) +class DescribeConfigsResponse_v2(Response): + API_KEY = 32 + API_VERSION = 2 + SCHEMA = Schema( + ('throttle_time_ms', Int32), + ('resources', Array( + ('error_code', Int16), + ('error_message', String('utf-8')), + ('resource_type', Int8), + ('resource_name', String('utf-8')), + ('config_entries', Array( + ('config_names', String('utf-8')), + ('config_value', String('utf-8')), + ('read_only', Boolean), + ('config_source', Int8), + ('is_sensitive', Boolean), + ('config_synonyms', Array( + ('config_name', String('utf-8')), + ('config_value', String('utf-8')), + ('config_source', Int8))))))) + ) + class DescribeConfigsRequest_v0(Request): API_KEY = 32 API_VERSION = 0 @@ -731,8 +753,20 @@ class DescribeConfigsRequest_v1(Request): ('include_synonyms', Boolean) ) -DescribeConfigsRequest = [DescribeConfigsRequest_v0, DescribeConfigsRequest_v1] -DescribeConfigsResponse = [DescribeConfigsResponse_v0, DescribeConfigsResponse_v1] +class DescribeConfigsRequest_v2(Request): + API_KEY = 32 + API_VERSION = 2 + RESPONSE_TYPE = DescribeConfigsResponse_v2 + SCHEMA = DescribeConfigsRequest_v2.SCHEMA + +DescribeConfigsRequest = [ + DescribeConfigsRequest_v0, DescribeConfigsRequest_v1, + DescribeConfigsRequest_v2, +] +DescribeConfigsResponse = [ + DescribeConfigsResponse_v0, DescribeConfigsResponse_v1, + DescribeConfigsResponse_v2, +] class SaslAuthenticateResponse_v0(Response): API_KEY = 36