kafka_rest_proxy_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +129 -0
- data/Rakefile +8 -0
- data/bin/console +9 -0
- data/docs/Body.md +12 -0
- data/docs/InlineResponse200.md +10 -0
- data/docs/InlineResponse200Offsets.md +11 -0
- data/docs/Offset.md +11 -0
- data/docs/ProducerApi.md +58 -0
- data/docs/ProducerRequest.md +12 -0
- data/docs/ProducerResponse.md +10 -0
- data/docs/Record.md +10 -0
- data/docs/TopicstopicNameRecords.md +10 -0
- data/git_push.sh +55 -0
- data/kafka_rest_proxy_client.gemspec +33 -0
- data/lib/kafka_rest_proxy_client.rb +48 -0
- data/lib/kafka_rest_proxy_client/api/producer_api.rb +69 -0
- data/lib/kafka_rest_proxy_client/api_client.rb +364 -0
- data/lib/kafka_rest_proxy_client/api_error.rb +26 -0
- data/lib/kafka_rest_proxy_client/configuration.rb +184 -0
- data/lib/kafka_rest_proxy_client/models/body.rb +214 -0
- data/lib/kafka_rest_proxy_client/models/inline_response_200.rb +196 -0
- data/lib/kafka_rest_proxy_client/models/inline_response_200_offsets.rb +203 -0
- data/lib/kafka_rest_proxy_client/models/offset.rb +203 -0
- data/lib/kafka_rest_proxy_client/models/producer_request.rb +214 -0
- data/lib/kafka_rest_proxy_client/models/producer_response.rb +196 -0
- data/lib/kafka_rest_proxy_client/models/record.rb +194 -0
- data/lib/kafka_rest_proxy_client/models/topicstopic_name_records.rb +194 -0
- data/lib/kafka_rest_proxy_client/version.rb +3 -0
- data/spec/api/producer_api_spec.rb +47 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/body_spec.rb +65 -0
- data/spec/models/inline_response_200_offsets_spec.rb +59 -0
- data/spec/models/inline_response_200_spec.rb +53 -0
- data/spec/models/offset_spec.rb +59 -0
- data/spec/models/producer_request_spec.rb +65 -0
- data/spec/models/producer_response_spec.rb +53 -0
- data/spec/models/record_spec.rb +53 -0
- data/spec/models/topicstopic_name_records_spec.rb +53 -0
- data/spec/spec_helper.rb +110 -0
- data/swagger.yml +170 -0
- metadata +279 -0
data/swagger.yml
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
---
|
2
|
+
swagger: '2.0'
|
3
|
+
info:
|
4
|
+
version: 0.1.0
|
5
|
+
title: Kafka REST Proxy API
|
6
|
+
description: |
|
7
|
+
An initial draft of the [Kafka REST Proxy API](https://github.com/confluentinc/kafka-rest).
|
8
|
+
|
9
|
+
## Example JSON request
|
10
|
+
|
11
|
+
|
12
|
+
```
|
13
|
+
POST /topics/test HTTP/1.1
|
14
|
+
Host: kafkaproxy.example.com
|
15
|
+
Content-Type: application/vnd.kafka.json.v2+json
|
16
|
+
Accept: application/vnd.kafka.v2+json, application/vnd.kafka+json, application/json
|
17
|
+
{
|
18
|
+
"records": [
|
19
|
+
{
|
20
|
+
"key": "somekey",
|
21
|
+
"value": {"foo": "bar"}
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"value": [ "foo", "bar" ],
|
25
|
+
"partition": 1
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"value": 53.5
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
```
|
33
|
+
|
34
|
+
## Example JSON response
|
35
|
+
|
36
|
+
```
|
37
|
+
HTTP/1.1 200 OK
|
38
|
+
Content-Type: application/vnd.kafka.v2+json
|
39
|
+
{
|
40
|
+
"key_schema_id": null,
|
41
|
+
"value_schema_id": null,
|
42
|
+
"offsets": [
|
43
|
+
{
|
44
|
+
"partition": 2,
|
45
|
+
"offset": 100
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"partition": 1,
|
49
|
+
"offset": 101
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"partition": 2,
|
53
|
+
"offset": 102
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
```
|
58
|
+
tags:
|
59
|
+
- name: Producer
|
60
|
+
|
61
|
+
consumes:
|
62
|
+
- application/vnd.kafka.v2+json
|
63
|
+
- application/vnd.kafka+json
|
64
|
+
- application/json
|
65
|
+
|
66
|
+
produces:
|
67
|
+
- application/vnd.kafka.v2+json
|
68
|
+
- application/vnd.kafka+json
|
69
|
+
- application/json
|
70
|
+
|
71
|
+
|
72
|
+
parameters:
|
73
|
+
topic_name:
|
74
|
+
name: topic_name
|
75
|
+
in: path
|
76
|
+
description: Name of the topic to produce the messages to
|
77
|
+
type: string
|
78
|
+
required: true
|
79
|
+
|
80
|
+
paths:
|
81
|
+
/topics/{topic_name}:
|
82
|
+
post:
|
83
|
+
tags:
|
84
|
+
- Producer
|
85
|
+
description: |
|
86
|
+
Produce messages to a topic, optionally specifying keys or partitions for the messages. If no partition is provided, one will be chosen based on the hash of the key. If no key is provided, the partition will be chosen for each message in a round-robin fashion.
|
87
|
+
|
88
|
+
#
|
89
|
+
|
90
|
+
For the ``avro`` embedded format, you must provide information about schemas and the REST proxy must be configured with the URL to access the schema registry (``schema.registry.connect``). Schemas may be provided as the full schema encoded as a string, or, after the initial request may be provided as the schema ID returned with the first response.
|
91
|
+
responses:
|
92
|
+
200:
|
93
|
+
description: Successfully produced data to the kafka topic.
|
94
|
+
schema:
|
95
|
+
$ref: '#/definitions/ProducerResponse'
|
96
|
+
404:
|
97
|
+
description: |
|
98
|
+
* Error code 40401
|
99
|
+
* Topic not found.
|
100
|
+
422:
|
101
|
+
description: |
|
102
|
+
* Error code 42201
|
103
|
+
* Request includes keys and uses a format that requires schemas, but does not include the ``key_schema`` or ``key_schema_id`` fields.
|
104
|
+
* Error code 42202
|
105
|
+
* Request includes values and uses a format that requires schemas, but does not include the ``value_schema`` or ``value_schema_id`` fields.
|
106
|
+
* Error code 42205
|
107
|
+
* Request includes invalid schema.
|
108
|
+
|
109
|
+
parameters:
|
110
|
+
- $ref: '#/parameters/topic_name'
|
111
|
+
- name: body
|
112
|
+
in: body
|
113
|
+
description: Data to send to the kafka topic.
|
114
|
+
required: true
|
115
|
+
schema:
|
116
|
+
$ref: '#/definitions/ProducerRequest'
|
117
|
+
|
118
|
+
definitions:
|
119
|
+
ProducerRequest:
|
120
|
+
type: object
|
121
|
+
properties:
|
122
|
+
records:
|
123
|
+
type: array
|
124
|
+
items:
|
125
|
+
$ref: '#/definitions/Record'
|
126
|
+
key_schema:
|
127
|
+
type: string
|
128
|
+
key_schema_id:
|
129
|
+
type: integer
|
130
|
+
value_schema:
|
131
|
+
type: string
|
132
|
+
value_schema_id:
|
133
|
+
type: integer
|
134
|
+
|
135
|
+
ProducerResponse:
|
136
|
+
type: object
|
137
|
+
properties:
|
138
|
+
offsets:
|
139
|
+
type: array
|
140
|
+
items:
|
141
|
+
$ref: '#/definitions/Offset'
|
142
|
+
key_schema_id:
|
143
|
+
type: integer
|
144
|
+
value_schema_id:
|
145
|
+
type: integer
|
146
|
+
|
147
|
+
Record:
|
148
|
+
type: object
|
149
|
+
properties:
|
150
|
+
key:
|
151
|
+
type: object
|
152
|
+
value:
|
153
|
+
type: object
|
154
|
+
partition:
|
155
|
+
type: integer
|
156
|
+
|
157
|
+
Offset:
|
158
|
+
type: object
|
159
|
+
properties:
|
160
|
+
partition:
|
161
|
+
type: integer
|
162
|
+
offset:
|
163
|
+
type: integer
|
164
|
+
error_code:
|
165
|
+
type: integer
|
166
|
+
error:
|
167
|
+
type: string
|
168
|
+
|
169
|
+
|
170
|
+
|
metadata
ADDED
@@ -0,0 +1,279 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kafka_rest_proxy_client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Swagger-Codegen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: typhoeus
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.0.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.0.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: json
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.8'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.8.3
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.8'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.8.3
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '3.4'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.4.0
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.4'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 3.4.0
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: vcr
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '3.0'
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.0.1
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 3.0.1
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: webmock
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '1.24'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.24.3
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.24'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.24.3
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: autotest
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '4.4'
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 4.4.6
|
123
|
+
type: :development
|
124
|
+
prerelease: false
|
125
|
+
version_requirements: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '4.4'
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 4.4.6
|
133
|
+
- !ruby/object:Gem::Dependency
|
134
|
+
name: autotest-rails-pure
|
135
|
+
requirement: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '4.1'
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 4.1.2
|
143
|
+
type: :development
|
144
|
+
prerelease: false
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '4.1'
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 4.1.2
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: autotest-growl
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.2'
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 0.2.16
|
163
|
+
type: :development
|
164
|
+
prerelease: false
|
165
|
+
version_requirements: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - "~>"
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0.2'
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 0.2.16
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: autotest-fsevent
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0.2'
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: 0.2.11
|
183
|
+
type: :development
|
184
|
+
prerelease: false
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - "~>"
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0.2'
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: 0.2.11
|
193
|
+
description: A ruby client for the Kafka REST Proxy API
|
194
|
+
email:
|
195
|
+
- ''
|
196
|
+
executables: []
|
197
|
+
extensions: []
|
198
|
+
extra_rdoc_files: []
|
199
|
+
files:
|
200
|
+
- Gemfile
|
201
|
+
- Gemfile.lock
|
202
|
+
- README.md
|
203
|
+
- Rakefile
|
204
|
+
- bin/console
|
205
|
+
- docs/Body.md
|
206
|
+
- docs/InlineResponse200.md
|
207
|
+
- docs/InlineResponse200Offsets.md
|
208
|
+
- docs/Offset.md
|
209
|
+
- docs/ProducerApi.md
|
210
|
+
- docs/ProducerRequest.md
|
211
|
+
- docs/ProducerResponse.md
|
212
|
+
- docs/Record.md
|
213
|
+
- docs/TopicstopicNameRecords.md
|
214
|
+
- git_push.sh
|
215
|
+
- kafka_rest_proxy_client.gemspec
|
216
|
+
- lib/kafka_rest_proxy_client.rb
|
217
|
+
- lib/kafka_rest_proxy_client/api/producer_api.rb
|
218
|
+
- lib/kafka_rest_proxy_client/api_client.rb
|
219
|
+
- lib/kafka_rest_proxy_client/api_error.rb
|
220
|
+
- lib/kafka_rest_proxy_client/configuration.rb
|
221
|
+
- lib/kafka_rest_proxy_client/models/body.rb
|
222
|
+
- lib/kafka_rest_proxy_client/models/inline_response_200.rb
|
223
|
+
- lib/kafka_rest_proxy_client/models/inline_response_200_offsets.rb
|
224
|
+
- lib/kafka_rest_proxy_client/models/offset.rb
|
225
|
+
- lib/kafka_rest_proxy_client/models/producer_request.rb
|
226
|
+
- lib/kafka_rest_proxy_client/models/producer_response.rb
|
227
|
+
- lib/kafka_rest_proxy_client/models/record.rb
|
228
|
+
- lib/kafka_rest_proxy_client/models/topicstopic_name_records.rb
|
229
|
+
- lib/kafka_rest_proxy_client/version.rb
|
230
|
+
- spec/api/producer_api_spec.rb
|
231
|
+
- spec/api_client_spec.rb
|
232
|
+
- spec/configuration_spec.rb
|
233
|
+
- spec/models/body_spec.rb
|
234
|
+
- spec/models/inline_response_200_offsets_spec.rb
|
235
|
+
- spec/models/inline_response_200_spec.rb
|
236
|
+
- spec/models/offset_spec.rb
|
237
|
+
- spec/models/producer_request_spec.rb
|
238
|
+
- spec/models/producer_response_spec.rb
|
239
|
+
- spec/models/record_spec.rb
|
240
|
+
- spec/models/topicstopic_name_records_spec.rb
|
241
|
+
- spec/spec_helper.rb
|
242
|
+
- swagger.yml
|
243
|
+
homepage: https://github.com/swagger-api/swagger-codegen
|
244
|
+
licenses:
|
245
|
+
- Apache 2.0
|
246
|
+
metadata: {}
|
247
|
+
post_install_message:
|
248
|
+
rdoc_options: []
|
249
|
+
require_paths:
|
250
|
+
- lib
|
251
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
252
|
+
requirements:
|
253
|
+
- - ">="
|
254
|
+
- !ruby/object:Gem::Version
|
255
|
+
version: '1.9'
|
256
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
|
+
requirements:
|
258
|
+
- - ">="
|
259
|
+
- !ruby/object:Gem::Version
|
260
|
+
version: '0'
|
261
|
+
requirements: []
|
262
|
+
rubyforge_project:
|
263
|
+
rubygems_version: 2.4.5.1
|
264
|
+
signing_key:
|
265
|
+
specification_version: 4
|
266
|
+
summary: Kafka REST Proxy API Ruby Gem
|
267
|
+
test_files:
|
268
|
+
- spec/api/producer_api_spec.rb
|
269
|
+
- spec/api_client_spec.rb
|
270
|
+
- spec/configuration_spec.rb
|
271
|
+
- spec/models/body_spec.rb
|
272
|
+
- spec/models/inline_response_200_offsets_spec.rb
|
273
|
+
- spec/models/inline_response_200_spec.rb
|
274
|
+
- spec/models/offset_spec.rb
|
275
|
+
- spec/models/producer_request_spec.rb
|
276
|
+
- spec/models/producer_response_spec.rb
|
277
|
+
- spec/models/record_spec.rb
|
278
|
+
- spec/models/topicstopic_name_records_spec.rb
|
279
|
+
- spec/spec_helper.rb
|