Beispiel #1
0
class DescribeGroupsRequest_v0(Request):
    API_KEY = 15
    API_VERSION = 0
    RESPONSE_TYPE = DescribeGroupsResponse_v0
    SCHEMA = Schema(
        ('groups', Array(String('utf-8')))
    )
Beispiel #2
0
class CreateTopicsResponse_v2(Response):
    API_KEY = 19
    API_VERSION = 2
    SCHEMA = Schema(('throttle_time_ms', Int32),
                    ('topic_error_codes',
                     Array(('topic', String('utf-8')), ('error_code', Int16),
                           ('error_message', String('utf-8')))))
Beispiel #3
0
class ApiVersionResponse_v0(Response):
    API_KEY = 18
    API_VERSION = 0
    SCHEMA = Schema(('error_code', Int16),
                    ('api_versions',
                     Array(('api_key', Int16), ('min_version', Int16),
                           ('max_version', Int16))))
Beispiel #4
0
class ListGroupsResponse_v1(Response):
    API_KEY = 16
    API_VERSION = 1
    SCHEMA = Schema(('throttle_time_ms', Int32), ('error_code', Int16),
                    ('groups',
                     Array(('group', String('utf-8')),
                           ('protocol_type', String('utf-8')))))
Beispiel #5
0
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')))))
Beispiel #6
0
class CreateAclsResponse_v0(Response):
    API_KEY = 30
    API_VERSION = 0
    SCHEMA = Schema(('throttle_time_ms', Int32),
                    ('creation_responses',
                     Array(('error_code', Int16),
                           ('error_message', String('utf-8')))))
Beispiel #7
0
class FetchResponse_v5(Response):
    API_KEY = 1
    API_VERSION = 5
    SCHEMA = Schema(
        ('throttle_time_ms', Int32),
        ('topics',
         Array(
             ('topics', String('utf-8')),
             ('partitions',
              Array(('partition', Int32), ('error_code', Int16),
                    ('highwater_offset', Int64), ('last_stable_offset', Int64),
                    ('log_start_offset', Int64),
                    ('aborted_transactions',
                     Array(
                         ('producer_id', Int64),
                         ('first_offset', Int64))), ('message_set', Bytes))))))
Beispiel #8
0
class DescribeGroupsRequest_v3(Request):
    API_KEY = 15
    API_VERSION = 3
    RESPONSE_TYPE = DescribeGroupsResponse_v2
    SCHEMA = Schema(
        ("groups", Array(String("utf-8"))), ("include_authorized_operations", Boolean)
    )
Beispiel #9
0
class DeleteGroupsRequest_v0(Request):
    API_KEY = 42
    API_VERSION = 0
    RESPONSE_TYPE = DeleteGroupsResponse_v0
    SCHEMA = Schema(
        ("groups_names", Array(String("utf-8")))
    )
Beispiel #10
0
class DeleteTopicsResponse_v1(Response):
    API_KEY = 20
    API_VERSION = 1
    SCHEMA = Schema(
        ("throttle_time_ms", Int32),
        ("topic_error_codes", Array(("topic", String("utf-8")), ("error_code", Int16))),
    )
Beispiel #11
0
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))),
    )
Beispiel #12
0
class FetchRequest_v3(Request):
    API_KEY = 1
    API_VERSION = 3
    RESPONSE_TYPE = FetchResponse_v3
    SCHEMA = Schema(
        ('replica_id', Int32),
        ('max_wait_time', Int32),
        ('min_bytes', Int32),
        ('max_bytes', Int32),  # This new field is only difference from FR_v2
        ('topics', Array(
            ('topic', String('utf-8')),
            ('partitions', Array(
                ('partition', Int32),
                ('offset', Int64),
                ('max_bytes', Int32)))))
    )
Beispiel #13
0
class SaslHandShakeResponse_v0(Response):
    API_KEY = 17
    API_VERSION = 0
    SCHEMA = Schema(
        ('error_code', Int16),
        ('enabled_mechanisms', Array(String('utf-8')))
    )
Beispiel #14
0
class DescribeAclsResponse_v0(Response):
    API_KEY = 29
    API_VERSION = 0
    SCHEMA = Schema(
        ('throttle_time_ms', Int32),
        ('error_code', Int16),
        ('error_message', String('utf-8')),
        ('resources', Array(
            ('resource_type', Int8),
            ('resource_name', String('utf-8')),
            ('acls', Array(
                ('principal', String('utf-8')),
                ('host', String('utf-8')),
                ('operation', Int8),
                ('permission_type', Int8)))))
    )
Beispiel #15
0
class DescribeGroupsResponse_v3(Response):
    API_KEY = 15
    API_VERSION = 3
    SCHEMA = Schema(
        ('throttle_time_ms', Int32),
        ('groups',
         Array(('error_code', Int16), ('group', String('utf-8')),
               ('state', String('utf-8')), ('protocol_type', String('utf-8')),
               ('protocol', String('utf-8')),
               ('members',
                Array(('member_id', String('utf-8')),
                      ('client_id', String('utf-8')),
                      ('client_host', String('utf-8')),
                      ('member_metadata', Bytes),
                      ('member_assignment', Bytes)))),
         ('authorized_operations', Int32)))
Beispiel #16
0
class ListGroupsResponse_v0(Response):
    API_KEY = 16
    API_VERSION = 0
    SCHEMA = Schema(('error_code', Int16),
                    ('groups',
                     Array(('group', String('utf-8')),
                           ('protocol_type', String('utf-8')))))
class OffsetRequest_v4(Request):
    """
    Add current_leader_epoch to request
    """
    API_KEY = 2
    API_VERSION = 4
    RESPONSE_TYPE = OffsetResponse_v4
    SCHEMA = Schema(
        ('replica_id', Int32),
        ('isolation_level', Int8),  # <- added isolation_level
        ('topics',
         Array(('topic', String('utf-8')),
               ('partitions',
                Array(('partition', Int32), ('current_leader_epoch', Int64),
                      ('timestamp', Int64))))))
    DEFAULTS = {'replica_id': -1}
Beispiel #18
0
class DescribeConfigsResponse_v1(Response):
    API_KEY = 32
    API_VERSION = 1
    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_name', 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))))))))
Beispiel #19
0
class AlterConfigsResponse_v0(Response):
    API_KEY = 33
    API_VERSION = 0
    SCHEMA = Schema(
        ('throttle_time_ms', Int32),
        ('resources',
         Array(('error_code', Int16), ('error_message', String('utf-8')),
               ('resource_type', Int8), ('resource_name', String('utf-8')))))
Beispiel #20
0
 class TestClass(superclass):
     API_KEY = 0
     API_VERSION = 0
     RESPONSE_TYPE = None  # To satisfy the Request ABC
     SCHEMA = Schema(('myarray',
                      Array(('subobject', Int16),
                            ('othersubobject', String('utf-8')))),
                     ('notarray', Int16))
Beispiel #21
0
class DescribeConfigsResponseV0(Response):
    """
    DescribeConfigs in Kafka Protocol
    Response serialization
    """
    API_KEY = 32
    API_VERSION = 0
    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_name', String('utf-8')),
                      ('config_value', String('utf-8')),
                      ('read_only', Boolean), ('is_default', Boolean),
                      ('is_sensitive', Boolean))))))
Beispiel #22
0
class ApiVersionResponse_v1(Response):
    API_KEY = 18
    API_VERSION = 1
    SCHEMA = Schema(('error_code', Int16),
                    ('api_versions',
                     Array(('api_key', Int16), ('min_version', Int16),
                           ('max_version', Int16))),
                    ('throttle_time_ms', Int32))
Beispiel #23
0
class ProduceResponse_v1(Response):
    API_KEY = 0
    API_VERSION = 1
    SCHEMA = Schema(
        (
            "topics",
            Array(
                ("topic", String("utf-8")),
                (
                    "partitions",
                    Array(("partition", Int32), ("error_code", Int16),
                          ("offset", Int64)),
                ),
            ),
        ),
        ("throttle_time_ms", Int32),
    )
Beispiel #24
0
class CreateTopicsResponse_v0(Response):
    API_KEY = 19
    API_VERSION = 0
    SCHEMA = Schema(
        ('topic_errors', Array(
            ('topic', String('utf-8')),
            ('error_code', Int16)))
    )
Beispiel #25
0
class DescribeGroupsResponse_v0(Response):
    API_KEY = 15
    API_VERSION = 0
    SCHEMA = Schema(
        ('groups', Array(
            ('error_code', Int16),
            ('group', String('utf-8')),
            ('state', String('utf-8')),
            ('protocol_type', String('utf-8')),
            ('protocol', String('utf-8')),
            ('members', Array(
                ('member_id', String('utf-8')),
                ('client_id', String('utf-8')),
                ('client_host', String('utf-8')),
                ('member_metadata', Bytes),
                ('member_assignment', Bytes)))))
    )
Beispiel #26
0
class DeleteTopicsRequest_v0(Request):
    API_KEY = 20
    API_VERSION = 0
    RESPONSE_TYPE = DeleteTopicsResponse_v0
    SCHEMA = Schema(
        ('topics', Array(String('utf-8'))),
        ('timeout', Int32)
    )
Beispiel #27
0
class CreateTopicsRequest_v0(Request):
    API_KEY = 19
    API_VERSION = 0
    RESPONSE_TYPE = CreateTopicsResponse_v0
    SCHEMA = Schema(
        ('create_topic_requests', Array(
            ('topic', String('utf-8')),
            ('num_partitions', Int32),
            ('replication_factor', Int16),
            ('replica_assignment', Array(
                ('partition_id', Int32),
                ('replicas', Array(Int32)))),
            ('configs', Array(
                ('config_key', String('utf-8')),
                ('config_value', String('utf-8')))))),
        ('timeout', Int32)
    )
Beispiel #28
0
class MetadataRequest_v4(Request):
    API_KEY = 3
    API_VERSION = 4
    RESPONSE_TYPE = MetadataResponse_v4
    SCHEMA = Schema(("topics", Array(String("utf-8"))),
                    ("allow_auto_topic_creation", Boolean))
    ALL_TOPICS = -1  # Null Array (len -1) for topics returns all topics
    NO_TOPICS = None  # Empty array (len 0) for topics returns no topics
Beispiel #29
0
class AlterConfigsRequest_v0(Request):
    """
    AlterConfigs version 0 from Kafka protocol
    Request serialization
    """
    API_KEY = 33
    API_VERSION = 0
    RESPONSE_TYPE = AlterConfigsResponse_v0
    SCHEMA = Schema(
        ('resources', Array(
            ('resource_type', Int8),
            ('resource_name', String('utf-8')),
            ('config_entries', Array(
                ('config_name', String('utf-8')),
                ('config_value', String('utf-8')))))),
        ('validate_only', Boolean)
    )
Beispiel #30
0
class MetadataRequest_v0(Request):
    API_KEY = 3
    API_VERSION = 0
    RESPONSE_TYPE = MetadataResponse_v0
    SCHEMA = Schema(
        ('topics', Array(String('utf-8')))
    )
    ALL_TOPICS = None  # Empty Array (len 0) for topics returns all topics