kafka-ui-api.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. openapi: 3.0.0
  2. info:
  3. description: Api Documentation
  4. version: 0.1.0
  5. title: Api Documentation
  6. termsOfService: urn:tos
  7. contact: {}
  8. license:
  9. name: Apache 2.0
  10. url: http://www.apache.org/licenses/LICENSE-2.0
  11. tags:
  12. - name: /api/clusters
  13. servers:
  14. - url: /localhost
  15. paths:
  16. /api/clusters:
  17. get:
  18. tags:
  19. - /api/clusters
  20. summary: getClusters
  21. operationId: getClusters
  22. responses:
  23. 200:
  24. description: OK
  25. content:
  26. application/json:
  27. schema:
  28. type: array
  29. items:
  30. $ref: '#/components/schemas/Cluster'
  31. /api/clusters/{clusterName}/brokers:
  32. get:
  33. tags:
  34. - /api/clusters
  35. summary: getBrokers
  36. operationId: getBrokers
  37. parameters:
  38. - name: clusterName
  39. in: path
  40. required: true
  41. schema:
  42. type: string
  43. responses:
  44. 200:
  45. description: OK
  46. content:
  47. application/json:
  48. schema:
  49. type: array
  50. items:
  51. $ref: '#/components/schemas/Broker'
  52. /api/clusters/{clusterName}/metrics:
  53. get:
  54. tags:
  55. - /api/clusters
  56. summary: getClusterMetrics
  57. operationId: getClusterMetrics
  58. parameters:
  59. - name: clusterName
  60. in: path
  61. required: true
  62. schema:
  63. type: string
  64. responses:
  65. 200:
  66. description: OK
  67. content:
  68. application/json:
  69. schema:
  70. $ref: '#/components/schemas/ClusterMetrics'
  71. /api/clusters/{clusterName}/stats:
  72. get:
  73. tags:
  74. - /api/clusters
  75. summary: getClusterStats
  76. operationId: getClusterStats
  77. parameters:
  78. - name: clusterName
  79. in: path
  80. required: true
  81. schema:
  82. type: string
  83. responses:
  84. 200:
  85. description: OK
  86. content:
  87. application/json:
  88. schema:
  89. $ref: '#/components/schemas/ClusterStats'
  90. /api/clusters/{clusterName}/brokers/{id}/metrics:
  91. get:
  92. tags:
  93. - /api/clusters
  94. summary: getBrokersMetrics
  95. operationId: getBrokersMetrics
  96. parameters:
  97. - name: clusterName
  98. in: path
  99. required: true
  100. schema:
  101. type: string
  102. - name: id
  103. in: path
  104. required: true
  105. schema:
  106. type: integer
  107. responses:
  108. 200:
  109. description: OK
  110. content:
  111. application/json:
  112. schema:
  113. $ref: '#/components/schemas/BrokerMetrics'
  114. /api/clusters/{clusterName}/topics:
  115. get:
  116. tags:
  117. - /api/clusters
  118. summary: getTopics
  119. operationId: getTopics
  120. parameters:
  121. - name: clusterName
  122. in: path
  123. required: true
  124. schema:
  125. type: string
  126. responses:
  127. 200:
  128. description: OK
  129. content:
  130. application/json:
  131. schema:
  132. type: array
  133. items:
  134. $ref: '#/components/schemas/Topic'
  135. post:
  136. tags:
  137. - /api/clusters
  138. summary: createTopic
  139. operationId: createTopic
  140. parameters:
  141. - name: clusterName
  142. in: path
  143. required: true
  144. schema:
  145. type: string
  146. requestBody:
  147. content:
  148. application/json:
  149. schema:
  150. $ref: '#/components/schemas/TopicFormData'
  151. responses:
  152. 201:
  153. description: Created
  154. content:
  155. application/json:
  156. schema:
  157. $ref: '#/components/schemas/Topic'
  158. /api/clusters/{clusterName}/topics/{topicName}:
  159. get:
  160. tags:
  161. - /api/clusters
  162. summary: getTopicDetails
  163. operationId: getTopicDetails
  164. parameters:
  165. - name: clusterName
  166. in: path
  167. required: true
  168. schema:
  169. type: string
  170. - name: topicName
  171. in: path
  172. required: true
  173. schema:
  174. type: string
  175. responses:
  176. 200:
  177. description: OK
  178. content:
  179. application/json:
  180. schema:
  181. $ref: '#/components/schemas/TopicDetails'
  182. patch:
  183. tags:
  184. - /api/clusters
  185. summary: updateTopic
  186. operationId: updateTopic
  187. parameters:
  188. - name: clusterName
  189. in: path
  190. required: true
  191. schema:
  192. type: string
  193. - name: topicName
  194. in: path
  195. required: true
  196. schema:
  197. type: string
  198. requestBody:
  199. content:
  200. application/json:
  201. schema:
  202. $ref: '#/components/schemas/TopicFormData'
  203. responses:
  204. 200:
  205. description: Updated
  206. content:
  207. application/json:
  208. schema:
  209. $ref: '#/components/schemas/Topic'
  210. /api/clusters/{clusterName}/topics/{topicName}/config:
  211. get:
  212. tags:
  213. - /api/clusters
  214. summary: getTopicConfigs
  215. operationId: getTopicConfigs
  216. parameters:
  217. - name: clusterName
  218. in: path
  219. required: true
  220. schema:
  221. type: string
  222. - name: topicName
  223. in: path
  224. required: true
  225. schema:
  226. type: string
  227. responses:
  228. 200:
  229. description: OK
  230. content:
  231. application/json:
  232. schema:
  233. type: array
  234. items:
  235. $ref: '#/components/schemas/TopicConfig'
  236. /api/clusters/{clusterName}/topics/{topicName}/messages:
  237. get:
  238. tags:
  239. - /api/clusters
  240. summary: getTopicMessages
  241. operationId: getTopicMessages
  242. parameters:
  243. - name: clusterName
  244. in: path
  245. required: true
  246. schema:
  247. type: string
  248. - name: topicName
  249. in: path
  250. required: true
  251. schema:
  252. type: string
  253. - name: seekType
  254. in: query
  255. schema:
  256. $ref: "#/components/schemas/SeekType"
  257. - name: seekTo
  258. in: query
  259. schema:
  260. type: array
  261. items:
  262. type: string
  263. description: The format is [partition]::[offset] for specifying offsets or [partition]::[timstamp in millis] for specifying timestamps
  264. - name: limit
  265. in: query
  266. schema:
  267. type: integer
  268. - name: q
  269. in: query
  270. schema:
  271. type: string
  272. responses:
  273. 200:
  274. description: OK
  275. content:
  276. application/json:
  277. schema:
  278. type: array
  279. items:
  280. $ref: '#/components/schemas/TopicMessage'
  281. /api/clusters/{clusterName}/consumer-groups/{id}:
  282. get:
  283. tags:
  284. - /api/clusters
  285. summary: get Consumer Group By Id
  286. operationId: getConsumerGroup
  287. parameters:
  288. - name: clusterName
  289. in: path
  290. required: true
  291. schema:
  292. type: string
  293. - name: id
  294. in: path
  295. required: true
  296. schema:
  297. type: string
  298. responses:
  299. 200:
  300. description: OK
  301. content:
  302. application/json:
  303. schema:
  304. $ref: '#/components/schemas/ConsumerGroupDetails'
  305. /api/clusters/{clusterName}/consumerGroups:
  306. get:
  307. tags:
  308. - /api/clusters
  309. summary: get all ConsumerGroups
  310. operationId: getConsumerGroups
  311. parameters:
  312. - name: clusterName
  313. in: path
  314. required: true
  315. schema:
  316. type: string
  317. responses:
  318. 200:
  319. description: OK
  320. content:
  321. application/json:
  322. schema:
  323. type: array
  324. items:
  325. $ref: '#/components/schemas/ConsumerGroup'
  326. /api/clusters/{clusterName}/schema/subjects:
  327. get:
  328. tags:
  329. - /api/clusters
  330. summary: get all subjects from schema registry
  331. operationId: getSchemaSubjects
  332. parameters:
  333. - name: clusterName
  334. in: path
  335. required: true
  336. schema:
  337. type: string
  338. responses:
  339. 200:
  340. description: OK
  341. content:
  342. application/json:
  343. schema:
  344. type: array
  345. items:
  346. type: string
  347. components:
  348. schemas:
  349. Cluster:
  350. type: object
  351. properties:
  352. name:
  353. type: string
  354. defaultCluster:
  355. type: boolean
  356. status:
  357. $ref: '#/components/schemas/ServerStatus'
  358. brokerCount:
  359. type: integer
  360. onlinePartitionCount:
  361. type: integer
  362. topicCount:
  363. type: integer
  364. bytesInPerSec:
  365. type: number
  366. bytesOutPerSec:
  367. type: number
  368. required:
  369. - id
  370. - name
  371. - status
  372. ServerStatus:
  373. type: string
  374. enum:
  375. - online
  376. - offline
  377. ClusterMetrics:
  378. type: object
  379. properties:
  380. items:
  381. type: array
  382. items:
  383. $ref: '#/components/schemas/Metric'
  384. ClusterStats:
  385. type: object
  386. properties:
  387. brokerCount:
  388. type: integer
  389. zooKeeperStatus:
  390. type: integer
  391. activeControllers:
  392. type: integer
  393. onlinePartitionCount:
  394. type: integer
  395. offlinePartitionCount:
  396. type: integer
  397. inSyncReplicasCount:
  398. type: integer
  399. outOfSyncReplicasCount:
  400. type: integer
  401. underReplicatedPartitionCount:
  402. type: integer
  403. diskUsage:
  404. type: array
  405. items:
  406. $ref: '#/components/schemas/BrokerDiskUsage'
  407. BrokerDiskUsage:
  408. type: object
  409. properties:
  410. brokerId:
  411. type: integer
  412. segmentSize:
  413. type: integer
  414. format: int64
  415. segmentCount:
  416. type: integer
  417. required:
  418. - brokerId
  419. BrokerMetrics:
  420. type: object
  421. properties:
  422. segmentSize:
  423. type: integer
  424. format: int64
  425. segmentCount:
  426. type: integer
  427. metrics:
  428. type: array
  429. items:
  430. $ref: '#/components/schemas/Metric'
  431. Topic:
  432. type: object
  433. properties:
  434. name:
  435. type: string
  436. internal:
  437. type: boolean
  438. partitionCount:
  439. type: integer
  440. replicationFactor:
  441. type: integer
  442. replicas:
  443. type: integer
  444. inSyncReplicas:
  445. type: integer
  446. segmentSize:
  447. type: integer
  448. segmentCount:
  449. type: integer
  450. underReplicatedPartitions:
  451. type: integer
  452. partitions:
  453. type: array
  454. items:
  455. $ref: "#/components/schemas/Partition"
  456. required:
  457. - name
  458. Replica:
  459. type: object
  460. properties:
  461. broker:
  462. type: integer
  463. leader:
  464. type: boolean
  465. inSync:
  466. type: boolean
  467. TopicDetails:
  468. type: object
  469. properties:
  470. name:
  471. type: string
  472. internal:
  473. type: boolean
  474. partitions:
  475. type: array
  476. items:
  477. $ref: "#/components/schemas/Partition"
  478. partitionCount:
  479. type: integer
  480. replicationFactor:
  481. type: integer
  482. replicas:
  483. type: integer
  484. inSyncReplicas:
  485. type: integer
  486. bytesInPerSec:
  487. type: number
  488. bytesOutPerSec:
  489. type: number
  490. segmentSize:
  491. type: integer
  492. segmentCount:
  493. type: integer
  494. underReplicatedPartitions:
  495. type: integer
  496. required:
  497. - name
  498. TopicConfig:
  499. type: object
  500. properties:
  501. name:
  502. type: string
  503. value:
  504. type: string
  505. defaultValue:
  506. type: string
  507. required:
  508. - name
  509. TopicFormData:
  510. type: object
  511. properties:
  512. name:
  513. type: string
  514. partitions:
  515. type: integer
  516. replicationFactor:
  517. type: integer
  518. configs:
  519. type: object
  520. additionalProperties:
  521. type: string
  522. required:
  523. - name
  524. Broker:
  525. type: object
  526. properties:
  527. id:
  528. type: integer
  529. host:
  530. type: string
  531. required:
  532. - id
  533. ConsumerGroup:
  534. type: object
  535. properties:
  536. clusterId:
  537. type: string
  538. consumerGroupId:
  539. type: string
  540. numConsumers:
  541. type: integer
  542. numTopics:
  543. type: integer
  544. required:
  545. - clusterId
  546. - consumerGroupId
  547. TopicMessage:
  548. type: object
  549. properties:
  550. partition:
  551. type: integer
  552. offset:
  553. type: integer
  554. format: int64
  555. timestamp:
  556. type: string
  557. format: date-time
  558. timestampType:
  559. type: string
  560. enum:
  561. - NO_TIMESTAMP_TYPE
  562. - CREATE_TIME
  563. - LOG_APPEND_TIME
  564. key:
  565. type: string
  566. headers:
  567. type: object
  568. additionalProperties:
  569. type: string
  570. content:
  571. type: object
  572. required:
  573. - partition
  574. - offset
  575. - timestamp
  576. SeekType:
  577. type: string
  578. enum:
  579. - BEGINNING
  580. - OFFSET
  581. - TIMESTAMP
  582. Partition:
  583. type: object
  584. properties:
  585. partition:
  586. type: integer
  587. leader:
  588. type: integer
  589. replicas:
  590. type: array
  591. items:
  592. $ref: '#/components/schemas/Replica'
  593. offsetMax:
  594. type: integer
  595. format: int64
  596. offsetMin:
  597. type: integer
  598. format: int64
  599. required:
  600. - topic
  601. - partition
  602. - offsetMax
  603. - offsetMin
  604. ConsumerTopicPartitionDetail:
  605. type: object
  606. properties:
  607. consumerId:
  608. type: string
  609. topic:
  610. type: string
  611. host:
  612. type: string
  613. partition:
  614. type: integer
  615. currentOffset:
  616. type: integer
  617. format: int64
  618. endOffset:
  619. type: integer
  620. format: int64
  621. messagesBehind:
  622. type: integer
  623. format: int64
  624. required:
  625. - consumerId
  626. ConsumerGroupDetails:
  627. type: object
  628. properties:
  629. consumerGroupId:
  630. type: string
  631. consumers:
  632. type: array
  633. items:
  634. $ref: '#/components/schemas/ConsumerTopicPartitionDetail'
  635. required:
  636. - consumerGroupId
  637. Metric:
  638. type: object
  639. properties:
  640. name:
  641. type: string
  642. canonicalName:
  643. type: string
  644. params:
  645. type: string
  646. additionalProperties:
  647. type: string
  648. value:
  649. type: string
  650. additionalProperties:
  651. type: number