Skip to content

Commit 7538a6a

Browse files
fix(openapi): update kafka-admin/v1 OpenAPI document (#315)
Co-authored-by: app-services-ci <app-services-ci@users.noreply.github.com>
1 parent efb122d commit 7538a6a

File tree

1 file changed

+193
-0
lines changed

1 file changed

+193
-0
lines changed

.openapi/kafka-admin-rest.yaml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ tags:
1919
description: Consumer Group Management
2020
- name: acls
2121
description: Access Control Management (ACLs)
22+
- name: records
23+
description: Send and receive records interactively
2224
paths:
2325
/rest/topics:
2426
get:
@@ -790,6 +792,114 @@ paths:
790792
$ref: '#/components/responses/NotAuthorized'
791793
"500":
792794
$ref: '#/components/responses/ServerError'
795+
/rest/topics/{topicName}/records:
796+
get:
797+
tags:
798+
- records
799+
summary: Consume records from a topic
800+
description: "Consume a limited number of records from a topic, optionally specifying\
801+
\ a partition and an absolute offset or timestamp as the starting point for\
802+
\ message retrieval."
803+
operationId: consumeRecords
804+
parameters:
805+
- name: topicName
806+
in: path
807+
description: Topic name
808+
required: true
809+
schema:
810+
type: string
811+
- name: include
812+
in: query
813+
description: List of properties to include for each record in the response
814+
schema:
815+
type: array
816+
items:
817+
$ref: '#/components/schemas/RecordIncludedProperty'
818+
explode: false
819+
- name: limit
820+
in: query
821+
description: Limit the number of records fetched and returned
822+
schema:
823+
format: int32
824+
default: "20"
825+
type: integer
826+
- name: offset
827+
in: query
828+
description: "Retrieve messages with an offset equal to or greater than this\
829+
\ offset. If both `timestamp` and `offset` are requested, `timestamp` is\
830+
\ given preference."
831+
schema:
832+
format: int32
833+
type: integer
834+
- name: partition
835+
in: query
836+
description: Retrieve messages only from this partition
837+
schema:
838+
format: int32
839+
type: integer
840+
- name: timestamp
841+
in: query
842+
description: "Retrieve messages with a timestamp equal to or later than this\
843+
\ timestamp. If both `timestamp` and `offset` are requested, `timestamp`\
844+
\ is given preference."
845+
schema:
846+
format: date-time
847+
responses:
848+
"400":
849+
$ref: '#/components/responses/BadRequest'
850+
"401":
851+
$ref: '#/components/responses/NotAuthorized'
852+
"403":
853+
$ref: '#/components/responses/Forbidden'
854+
"500":
855+
$ref: '#/components/responses/ServerError'
856+
"503":
857+
$ref: '#/components/responses/ServiceUnavailable'
858+
"200":
859+
description: List of records matching the request query parameters.
860+
content:
861+
application/json:
862+
schema:
863+
$ref: '#/components/schemas/RecordList'
864+
post:
865+
tags:
866+
- records
867+
summary: Send a record to a topic
868+
description: Produce (write) a single record to a topic.
869+
operationId: produceRecord
870+
parameters:
871+
- name: topicName
872+
in: path
873+
description: Topic name
874+
required: true
875+
schema:
876+
type: string
877+
requestBody:
878+
content:
879+
application/json:
880+
schema:
881+
$ref: '#/components/schemas/Record'
882+
examples:
883+
RecordProduceExample:
884+
$ref: '#/components/examples/RecordProduceExample'
885+
required: true
886+
responses:
887+
"400":
888+
$ref: '#/components/responses/BadRequest'
889+
"401":
890+
$ref: '#/components/responses/NotAuthorized'
891+
"403":
892+
$ref: '#/components/responses/Forbidden'
893+
"500":
894+
$ref: '#/components/responses/ServerError'
895+
"503":
896+
$ref: '#/components/responses/ServiceUnavailable'
897+
"201":
898+
description: Record was successfully sent to the topic
899+
content:
900+
application/json:
901+
schema:
902+
$ref: '#/components/schemas/Record'
793903
components:
794904
schemas:
795905
AclBinding:
@@ -1303,6 +1413,81 @@ components:
13031413
- id: 1
13041414
leader:
13051415
id: 1
1416+
Record:
1417+
title: Record
1418+
description: An individual record consumed from a topic or produced to a topic
1419+
required:
1420+
- value
1421+
type: object
1422+
properties:
1423+
partition:
1424+
format: int32
1425+
description: The record's partition within the topic
1426+
type: integer
1427+
offset:
1428+
format: int64
1429+
description: The record's offset within the topic partition
1430+
type: integer
1431+
readOnly: true
1432+
timestamp:
1433+
format: date-time
1434+
description: "Timestamp associated with the record. The type is indicated\
1435+
\ by `timestampType`. When producing a record, this value will be used\
1436+
\ as the record's `CREATE_TIME`."
1437+
type: string
1438+
timestampType:
1439+
description: Type of timestamp associated with the record
1440+
type: string
1441+
readOnly: true
1442+
headers:
1443+
description: "Record headers, key/value pairs"
1444+
type: object
1445+
additionalProperties:
1446+
type: string
1447+
key:
1448+
description: Record key
1449+
type: string
1450+
value:
1451+
description: Record value
1452+
type: string
1453+
nullable: false
1454+
RecordIncludedProperty:
1455+
enum:
1456+
- partition
1457+
- offset
1458+
- timestamp
1459+
- timestampType
1460+
- headers
1461+
- key
1462+
- value
1463+
type: string
1464+
RecordList:
1465+
title: Record List
1466+
description: A page of records consumed from a topic
1467+
required:
1468+
- items
1469+
- total
1470+
type: object
1471+
properties:
1472+
total:
1473+
format: int32
1474+
description: Total number of records returned in this request. This value
1475+
does not indicate the total number of records in the topic.
1476+
type: integer
1477+
nullable: false
1478+
size:
1479+
format: int32
1480+
description: Not used
1481+
type: integer
1482+
page:
1483+
format: int32
1484+
description: Not used
1485+
type: integer
1486+
items:
1487+
type: array
1488+
items:
1489+
$ref: '#/components/schemas/Record'
1490+
nullable: false
13061491
SortDirection:
13071492
enum:
13081493
- asc
@@ -1575,6 +1760,14 @@ components:
15751760
- topic: my-topic
15761761
partitions:
15771762
- 0
1763+
RecordProduceExample:
1764+
description: "Sample record to produce a record to partition 1, including a\
1765+
\ custom header"
1766+
value:
1767+
partition: 1
1768+
headers:
1769+
X-Custom-Header: header-value-1
1770+
value: "{ \"examplekey\": \"example-value\" }"
15781771
securitySchemes:
15791772
Bearer:
15801773
type: oauth2

0 commit comments

Comments
 (0)