forked from ibm-messaging/event-streams-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-rest-api.yaml
More file actions
674 lines (648 loc) · 22 KB
/
Copy pathadmin-rest-api.yaml
File metadata and controls
674 lines (648 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
#
# Copyright 2015 IBM
#
# Eclipse Public License - v 1.0
#
#THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
#LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
#CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
swagger: '2.0'
info:
title: Message Hub Administration REST API
version: "1"
schemes:
- https
consumes:
- application/json
produces:
- application/json
securityDefinitions:
X-Auth-Token:
type: apiKey
name: X-Auth-Token
in: header
description: >
A valid API key is required to access this API. API keys can be allocated
via the IBM Bluemix interface, and are associated with an instance of the
Message Hub service. API key values must be supplied on every REST request
using the `X-Auth-Token` HTTP header. Failure to specify a valid API key
will result in the REST request failing with a 401 (Unauthorized) status
code.
tags:
- name: Bridge
description: >
Methods that relate to administering bridges.
- name: Kafka Topic
description: >
Methods that relate to administering Kafka topics.
- name: Technology Preview
description: >
Methods tagged with the _Technology Preview_ tag are under active
development and may be subject to change.
paths:
# =====================================
# APIs for managing topics
# =====================================
/admin/topics:
get:
summary: List Kafka topics.
description: >
Returns a list containing information about all of the Kafka topics that
are defined for an instance of the Message Hub service. If there are
currently no topics defined then an empty list is returned.
tags:
- Kafka Topic
security:
- X-Auth-Token: []
responses:
'200':
description: >
Success. A list of topic information objects is returned in the
response body.
schema:
type: array
items:
$ref: '#/definitions/TopicInfo'
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
422:
description: >
The request contained syntactically valid JSON, but could not be
completed. For more information, consult the value of the
`errorMessage` property in the JSON object return as the response
body.
schema:
$ref: '#/definitions/ErrorInfo'
post:
summary: Create a Kafka topic.
description: >
Creates a new Kafka topic using the values supplied in the request body.
tags:
- Kafka Topic
security:
- X-Auth-Token: []
parameters:
- name: TopicCreateParam
description: >
A JSON object containing configuration parameters used to create the
Kafka topic.
in: body
required: true
schema:
$ref: '#/definitions/TopicCreateParam'
responses:
'202':
description: >
Topic creation request accepted. Topic creation occurs
asynchronously, and therefore invoking the list topics REST endpoint
may not immediately show newly created topics.
headers:
Location:
type: string
description: Location (resource URI) for the created topic.
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'422':
description: >
The request contained syntactically valid JSON, but could not be
completed. For more information, consult the value of the
`errorMessage` property in the JSON object return as the response
body.
schema:
$ref: '#/definitions/ErrorInfo'
/admin/topics/{name}:
delete:
summary: Delete a topic
description: Delete a Kafka topic based on the topic's name.
tags:
- Kafka Topic
security:
- X-Auth-Token: []
parameters:
- name: name
in: path
description: The name of the topic to be deleted.
required: true
type: string
responses:
'202':
description: >
The Topic delete request accepted. The Kafka topic deletion process
occurs asynchronously. Duplicate deletion requests for a topic which
is in the process of being deleted will return this status code.
Requests to delete a non-existent topic will also return this status
code.
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'422':
description: The topic has already been marked for deletion.
schema:
$ref: '#/definitions/ErrorInfo'
# =====================================
# APIs for managing bridges
# =====================================
/admin/bridges:
get:
summary: Lists bridges
description: >
Lists the bridges that are currently defined for an instance of the
Message Hub service. If no bridges are defined then an empty list is
returned from this call.
tags:
- Bridge
- Technology Preview
security:
- X-Auth-Token: []
responses:
'200':
description: >
Success. A list of bridge information objects is returned in the
response body.
schema:
type: array
items:
$ref: '#/definitions/BridgeInfo'
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
post:
summary: Creates a bridge
description: >
Creates a new instance of a Message Hub bridge.
tags:
- Bridge
- Technology Preview
parameters:
- name: ObjectStorageOutConfigParam
description: >
Configurable parameters for bridge creation.
in: body
required: true
schema:
$ref: '#/definitions/ObjectStorageOutConfigParam'
security:
- X-Auth-Token: []
responses:
'201':
description: The bridge was created.
headers:
Location:
type: string
description: Location (resource URI) for the created bridge
'400':
description: >
The JSON object describing the bridge to create is either
syntactically invalid, or does not contain one or more of the
required fields.
schema:
$ref: '#/definitions/ErrorInfo'
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'422':
description: >
Although the request was syntactically valid, it was not possible to
create the bridge. For more information, consult the value of the
`errorMessage` property in the JSON object return as the response
body.
schema:
$ref: '#/definitions/ErrorInfo'
'507':
description: >
The Message Hub service does not have sufficient resources to create
a new bridge at this time.
schema:
$ref: '#/definitions/ErrorInfo'
/admin/bridges/{name}:
get:
summary: Get information about a bridge.
tags:
- Bridge
- Technology Preview
description: >
Use the name of a bridge to retrieve information about the specific
bridge instance.
security:
- X-Auth-Token: []
parameters:
- name: name
in: path
description: The name of the bridge to retrieve information about.
required: true
type: string
responses:
'200':
description: Bridge information returned.
schema:
$ref: '#/definitions/BridgeInfo'
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'404':
description: No bridge exists with the specified bridge name.
schema:
$ref: '#/definitions/ErrorInfo'
delete:
summary: Delete a bridge.
tags:
- Bridge
- Technology Preview
description: >
Delete a specific instance of a bridge by specifying the name given to
the bridge when it was created.
security:
- X-Auth-Token: []
parameters:
- name: name
in: path
description: The name of the bridge to delete.
required: true
type: string
responses:
'204':
description: Bridge deleted.
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'404':
description: No bridge exists with the specified bridge name.
schema:
$ref: '#/definitions/ErrorInfo'
put:
summary: Update bridge parameters.
description: >
Replaces the parameters used to configure a bridge with a new set of
parameters. The bridge is automatically restarted to pick up the
changes.
tags:
- Bridge
- Technology Preview
security:
- X-Auth-Token: []
parameters:
- name: name
in: path
description: The name of the bridge to update.
required: true
type: string
- name: ObjectStorageOutConfigParam
description: >
A new set of configuration parameters to use when modifying an
existing instance of the bridge.
in: body
required: true
schema:
$ref: '#/definitions/ObjectStorageOutConfigParam'
responses:
'200':
description: Bridge updated with new parameters.
'400':
description: >
The JSON object describing the updates to the bridge is either
syntactically invalid, or does not contain one or more of the
required fields.
schema:
$ref: '#/definitions/ErrorInfo'
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'404':
description: No bridge exists with the specified bridge name.
schema:
$ref: '#/definitions/ErrorInfo'
'422':
description: >
Although the request was syntactically valid, it was not possible to
create the bridge. For more information, consult the value of the
`errorMessage` property in the JSON object return as the response
body.
schema:
$ref: '#/definitions/ErrorInfo'
/admin/bridges/{name}/pause:
post:
summary: Pause a bridge.
description: >
Suspend all processing done by a bridge. Pausing an already paused
bridge has no effect and returns a successful status code.
tags:
- Bridge
- Technology Preview
security:
- X-Auth-Token: []
parameters:
- name: name
in: path
description: The name of the bridge to pause.
required: true
type: string
responses:
'204':
description: The bridge is paused.
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'404':
description: No bridge exists with the specified bridge name.
schema:
$ref: '#/definitions/ErrorInfo'
/admin/bridges/{name}/resume:
post:
summary: Resume a bridge.
description: >
Resume the processing done by a bridge (reverse the effect of
pausing a bridge). Resuming an already running bridge has no effect
and returns a successful status code.
tags:
- Bridge
- Technology Preview
security:
- X-Auth-Token: []
parameters:
- name: name
in: path
description: The name of the bridge to resume.
required: true
type: string
responses:
'204':
description: The bridge is no longer paused.
'401':
description: >
Either no `X-Auth-Token` header was specified, or the value of the
`X-Auth-Token` header is not a valid API key that can be used to
successfully authenticate with the Message Hub Bluemix service.
schema:
$ref: '#/definitions/ErrorInfo'
'404':
description: No bridge exists with the specified bridge name.
schema:
$ref: '#/definitions/ErrorInfo'
definitions:
TopicInfo:
required:
- name
- retentionMs
- markedForDeletion
- partitions
properties:
name:
type: string
description: The name of the Kafka topic.
retentionMs:
type: integer
description: >
The retention period for the topic (in milliseconds). Messages are
stored on the topic for this period of time, after which they are
deleted.
markedForDeletion:
type: boolean
description: >
Set to true when a request has been made to delete the topic, but the
deletion process has not yet completed. Kafka implements topic
deletion as an asynchronous process.
partitions:
type: integer
description: The number of Kafka partitions allocated to the topic.
ErrorInfo:
required:
- errorCode
properties:
errorCode:
type: integer
description: Detailed error code qualifying response status code.
errorMessage:
type: string
description: An English language description of the error.
TopicCreateParam:
required:
- name
properties:
name:
type: string
description: The name of the topic.
configs:
type: object
description: Topic configuration parameters.
properties:
retentionMs:
type: integer
description: >
The amount of time messages are retained before they are deleted,
which is counted in milliseconds (in multiples of hours). This is
set per topic. Default is 24 hours. Minimum is 1 hour. Maximum is
30 days.
default: 86400000 # 24 hours
minimum: 3600000 # 1 hour
maximum: 2592000000 # 30 days
partitions:
type: integer
description: >
The number of partitions to assign to the topic.
minimum: 1
maximum: 100
default: 1
replicationFactor:
type: integer
description: >
The replication factor for this topic. This must be set to the value
3.
default: 3
minimum: 3
maximum: 3
BridgeInfo:
required:
- configuration
- state
properties:
configuration:
$ref: '#/definitions/ObjectStorageOutConfigParam'
state:
required:
- value
- message
type: object
description: The runtime state of the bridge.
properties:
value:
type: string
description: An enumeration representing the state of the bridge.
enum:
- paused
- running
- unavailable
message:
type: string
description: >
An English language message providing details about the status of
the bridge.
ObjectStorageOutConfigParam:
required:
- name
- topic
- type
- configuration
properties:
name:
type: string
description: The name of the bridge.
topic:
type: string
description: >
The Kafka topic that the bridge will consume messages from.
type:
type: string
description: >
Type of bridge. Currently this must be the value `objectStorageOut`.
enum:
- objectStorageOut
configuration:
type: object
description: >
Configuration that is used to connect to the Bluemix Object Storage
service and also determine how the bridge converts Kafka messages into
Object Storage service files.
required:
- credentials
- container
- partitioning
- uploadDurationThresholdSeconds
- uploadSizeThresholdKB
properties:
credentials:
type: object
description: >
The credentials used to connect to the Object Storage service.
required:
- authUrl
- region
- password
- projectId
- userId
properties:
authUrl:
type: string
description: >
The `auth_url` property from the Object Storage service
credentials.
region:
type: string
description: >
The `region` property from the Object Storage service
credentials.
password:
type: string
description: >
The `password` property from the Object Storage service
credentials.
projectId:
type: string
description: >
The `projectId` property from the Object Storage service
credentials.
userId:
type: string
description: >
The `userId` property from the Object Storage service
credentials.
container:
type: string
description: >
The name of the Object Storage service container into which
this bridge will upload files.
uploadDurationThresholdSeconds:
type: integer
description: >
The maximum amount of time (in seconds) that this bridge will
cache data read from Kafka before it uploads it as a file to
the Object Storage service.
minimum: 10
maximum: 21600 # 6 hours
uploadSizeThresholdKB:
type: integer
description: >
The maximum amount of data (in kilobytes) that this bridge
will read from Kafka and cache before it uploads it as a file
to the Object Storage service.
minimum: 1
maximum: 1048576 # 1GB
inputFormat:
type: string
description: >
The data format for the contents of the Kafka messages.
enum:
- json
partitioning:
type: array
description: >
An ordered array of partitioning schemes. These determine how
Kafka message data is placed into Object Storage service files
as well as the file names used.
items:
$ref: '#/definitions/BasePartitioningType'
BasePartitioningType:
discriminator: type
required:
- type
properties:
type:
type: string
description: >
The type of partitioning scheme to use. `dateIso8601` uses a value
parsed from the JSON in the source Kafka messages to determine the
Object Storage file name. `kafkaOffset` uses the offset within the
Kafka partition to determine the file name.
enum:
- dateIso8601
- kafkaOffset
DateIso8601PartitioningType:
allOf:
- $ref: '#/definitions/BasePartitioningType'
- type: object
required:
- propertyName
properties:
propertyName:
type: string
description: >
The name of a JSON property, present in the source Kafka messages,
that contains an ISO 8601 date. This date value will be used to
partition message data into Object Storage files.