kafka-ui/kafka-ui-contract/src/main/resources/swagger/kafka-ui-api.yaml

1640 lines
37 KiB
YAML

openapi: 3.0.0
info:
description: Api Documentation
version: 0.1.0
title: Api Documentation
termsOfService: urn:tos
contact: {}
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
tags:
- name: /api/clusters
- name: /api/clusters/connects
servers:
- url: /localhost
paths:
/api/clusters:
get:
tags:
- Clusters
summary: getClusters
operationId: getClusters
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Cluster'
/api/clusters/{clusterName}/brokers:
get:
tags:
- Brokers
summary: getBrokers
operationId: getBrokers
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Broker'
/api/clusters/{clusterName}/metrics:
get:
tags:
- Clusters
summary: getClusterMetrics
operationId: getClusterMetrics
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ClusterMetrics'
/api/clusters/{clusterName}/stats:
get:
tags:
- Clusters
summary: getClusterStats
operationId: getClusterStats
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ClusterStats'
/api/clusters/{clusterName}/brokers/{id}/metrics:
get:
tags:
- Brokers
summary: getBrokersMetrics
operationId: getBrokersMetrics
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: id
in: path
required: true
schema:
type: integer
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BrokerMetrics'
/api/clusters/{clusterName}/topics:
get:
tags:
- Topics
summary: getTopics
operationId: getTopics
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Topic'
post:
tags:
- Topics
summary: createTopic
operationId: createTopic
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TopicFormData'
responses:
201:
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/Topic'
/api/clusters/{clusterName}/topics/{topicName}:
get:
tags:
- Topics
summary: getTopicDetails
operationId: getTopicDetails
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: topicName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TopicDetails'
patch:
tags:
- Topics
summary: updateTopic
operationId: updateTopic
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: topicName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TopicFormData'
responses:
200:
description: Updated
content:
application/json:
schema:
$ref: '#/components/schemas/Topic'
delete:
tags:
- Topics
summary: deleteTopic
operationId: deleteTopic
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: topicName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
404:
description: Not found
/api/clusters/{clusterName}/topics/{topicName}/config:
get:
tags:
- Topics
summary: getTopicConfigs
operationId: getTopicConfigs
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: topicName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TopicConfig'
/api/clusters/{clusterName}/topics/{topicName}/messages:
get:
tags:
- Messages
summary: getTopicMessages
operationId: getTopicMessages
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: topicName
in: path
required: true
schema:
type: string
- name: seekType
in: query
schema:
$ref: "#/components/schemas/SeekType"
- name: seekTo
in: query
schema:
type: array
items:
type: string
description: The format is [partition]::[offset] for specifying offsets or [partition]::[timstamp in millis] for specifying timestamps
- name: limit
in: query
schema:
type: integer
- name: q
in: query
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TopicMessage'
delete:
tags:
- Messages
summary: deleteTopicMessages
operationId: deleteTopicMessages
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: topicName
in: path
required: true
schema:
type: string
- name: partitions
in: query
required: false
schema:
type: array
items:
type: integer
responses:
200:
description: OK
404:
description: Not found
/api/clusters/{clusterName}/consumer-groups/{id}:
get:
tags:
- Consumer Groups
summary: get Consumer Group By Id
operationId: getConsumerGroup
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: id
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConsumerGroupDetails'
/api/clusters/{clusterName}/consumerGroups:
get:
tags:
- Consumer Groups
summary: get all ConsumerGroups
operationId: getConsumerGroups
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConsumerGroup'
/api/clusters/{clusterName}/schemas:
post:
tags:
- Schemas
summary: create a new subject schema
operationId: createNewSchema
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NewSchemaSubject'
responses:
200:
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/SchemaSubject'
400:
description: Bad request
409:
description: Duplicate schema
422:
description: Invalid parameters
get:
tags:
- Schemas
summary: get all schemas of latest version from Schema Registry service
operationId: getSchemas
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SchemaSubject'
/api/clusters/{clusterName}/schemas/{subject}:
delete:
tags:
- Schemas
summary: delete schema from Schema Registry service
operationId: deleteSchema
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
responses:
200:
description: OK
404:
description: Not found
/api/clusters/{clusterName}/schemas/{subject}/versions:
get:
tags:
- Schemas
summary: get all version of subject from Schema Registry service
operationId: getAllVersionsBySubject
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SchemaSubject'
/api/clusters/{clusterName}/schemas/{subject}/latest:
get:
tags:
- Schemas
summary: get the latest schema from Schema Registry service
operationId: getLatestSchema
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SchemaSubject'
delete:
tags:
- Schemas
summary: delete the latest schema from schema registry
operationId: deleteLatestSchema
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
responses:
200:
description: OK
404:
description: Not found
/api/clusters/{clusterName}/schemas/{subject}/versions/{version}:
get:
tags:
- Schemas
summary: get schema by version from Schema Registry service
operationId: getSchemaByVersion
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
- name: version
in: path
required: true
schema:
type: integer
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SchemaSubject'
delete:
tags:
- Schemas
summary: delete schema by version from schema registry
operationId: deleteSchemaByVersion
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
- name: version
in: path
required: true
schema:
type: integer
responses:
200:
description: OK
404:
description: Not found
/api/clusters/{clusterName}/schemas/compatibility:
get:
tags:
- Schemas
summary: Get global schema compatibility level
operationId: getGlobalSchemaCompatibilityLevel
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CompatibilityLevel'
put:
tags:
- Schemas
summary: Update compatibility level globally
operationId: updateGlobalSchemaCompatibilityLevel
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CompatibilityLevel'
responses:
200:
description: OK
404:
description: Not Found
/api/clusters/{clusterName}/schemas/{subject}/compatibility:
put:
tags:
- Schemas
summary: Update compatibility level for specific schema.
operationId: updateSchemaCompatibilityLevel
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CompatibilityLevel'
responses:
200:
description: OK
404:
description: Not Found
/api/clusters/{clusterName}/schemas/{subject}/check:
post:
tags:
- Schemas
summary: Check compatibility of the schema.
operationId: checkSchemaCompatibility
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: subject
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NewSchemaSubject'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CompatibilityCheckResponse'
404:
description: Not Found
/api/clusters/{clusterName}/connects:
get:
tags:
- Kafka Connect
summary: get all kafka connect instances
operationId: getConnects
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Connect'
/api/clusters/{clusterName}/connects/{connectName}/connectors:
get:
tags:
- Kafka Connect
summary: get all connectors from Kafka Connect service
operationId: getConnectors
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
type: string
post:
tags:
- Kafka Connect
summary: create new connector
operationId: createConnector
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NewConnector'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Connector'
409:
description: rebalance is in progress
/api/clusters/{clusterName}/connects/{connectName}/connectors/{connectorName}:
get:
tags:
- Kafka Connect
summary: get information about the connector
operationId: getConnector
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Connector'
delete:
tags:
- Kafka Connect
summary: delete connector
operationId: deleteConnector
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
409:
description: rebalance is in progress
/api/clusters/{clusterName}/connects/{connectName}/connectors/{connectorName}/action/{action}:
post:
tags:
- Kafka Connect
summary: update connector state (restart, pause or resume)
operationId: updateConnectorState
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
- name: action
in: path
required: true
schema:
$ref: '#/components/schemas/ConnectorAction'
responses:
200:
description: OK
409:
description: rebalance is in progress
/api/clusters/{clusterName}/connects/{connectName}/connectors/{connectorName}/config:
get:
tags:
- Kafka Connect
summary: get connector configuration
operationId: getConnectorConfig
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorConfig'
put:
tags:
- Kafka Connect
summary: update or create connector with provided config
operationId: setConnectorConfig
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorConfig'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Connector'
409:
description: rebalance is in progress
/api/clusters/{clusterName}/connects/{connectName}/connectors/{connectorName}/tasks:
get:
tags:
- Kafka Connect
summary: get connector tasks
operationId: getConnectorTasks
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Task'
/api/clusters/{clusterName}/connects/{connectName}/connectors/{connectorName}/tasks/{taskId}/action/restart:
post:
tags:
- Kafka Connect
summary: restart connector task
operationId: restartConnectorTask
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: connectorName
in: path
required: true
schema:
type: string
- name: taskId
in: path
required: true
schema:
type: integer
responses:
200:
description: OK
/api/clusters/{clusterName}/connects/{connectName}/plugins:
get:
tags:
- Kafka Connect
summary: get connector plugins
operationId: getConnectorPlugins
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConnectorPlugin'
/api/clusters/{clusterName}/connects/{connectName}/plugins/{pluginName}/config/validate:
put:
tags:
- Kafka Connect
summary: validate connector plugin configuration
operationId: validateConnectorPluginConfig
parameters:
- name: clusterName
in: path
required: true
schema:
type: string
- name: connectName
in: path
required: true
schema:
type: string
- name: pluginName
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorConfig'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorPluginConfigValidationResponse'
components:
schemas:
Cluster:
type: object
properties:
name:
type: string
defaultCluster:
type: boolean
status:
$ref: '#/components/schemas/ServerStatus'
brokerCount:
type: integer
onlinePartitionCount:
type: integer
topicCount:
type: integer
bytesInPerSec:
type: number
bytesOutPerSec:
type: number
readOnly:
type: boolean
required:
- id
- name
- status
ServerStatus:
type: string
enum:
- online
- offline
ClusterMetrics:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/Metric'
ClusterStats:
type: object
properties:
brokerCount:
type: integer
zooKeeperStatus:
type: integer
activeControllers:
type: integer
onlinePartitionCount:
type: integer
offlinePartitionCount:
type: integer
inSyncReplicasCount:
type: integer
outOfSyncReplicasCount:
type: integer
underReplicatedPartitionCount:
type: integer
diskUsage:
type: array
items:
$ref: '#/components/schemas/BrokerDiskUsage'
BrokerDiskUsage:
type: object
properties:
brokerId:
type: integer
segmentSize:
type: integer
format: int64
segmentCount:
type: integer
required:
- brokerId
BrokerMetrics:
type: object
properties:
segmentSize:
type: integer
format: int64
segmentCount:
type: integer
metrics:
type: array
items:
$ref: '#/components/schemas/Metric'
Topic:
type: object
properties:
name:
type: string
internal:
type: boolean
partitionCount:
type: integer
replicationFactor:
type: integer
replicas:
type: integer
inSyncReplicas:
type: integer
segmentSize:
type: integer
segmentCount:
type: integer
underReplicatedPartitions:
type: integer
partitions:
type: array
items:
$ref: "#/components/schemas/Partition"
required:
- name
Replica:
type: object
properties:
broker:
type: integer
leader:
type: boolean
inSync:
type: boolean
TopicDetails:
type: object
properties:
name:
type: string
internal:
type: boolean
partitions:
type: array
items:
$ref: "#/components/schemas/Partition"
partitionCount:
type: integer
replicationFactor:
type: integer
replicas:
type: integer
inSyncReplicas:
type: integer
bytesInPerSec:
type: number
bytesOutPerSec:
type: number
segmentSize:
type: integer
segmentCount:
type: integer
underReplicatedPartitions:
type: integer
required:
- name
TopicConfig:
type: object
properties:
name:
type: string
value:
type: string
defaultValue:
type: string
required:
- name
TopicFormData:
type: object
properties:
name:
type: string
partitions:
type: integer
replicationFactor:
type: integer
configs:
type: object
additionalProperties:
type: string
required:
- name
Broker:
type: object
properties:
id:
type: integer
host:
type: string
required:
- id
ConsumerGroup:
type: object
properties:
clusterId:
type: string
consumerGroupId:
type: string
numConsumers:
type: integer
numTopics:
type: integer
required:
- clusterId
- consumerGroupId
TopicMessage:
type: object
properties:
partition:
type: integer
offset:
type: integer
format: int64
timestamp:
type: string
format: date-time
timestampType:
type: string
enum:
- NO_TIMESTAMP_TYPE
- CREATE_TIME
- LOG_APPEND_TIME
key:
type: string
headers:
type: object
additionalProperties:
type: string
content:
type: object
required:
- partition
- offset
- timestamp
SeekType:
type: string
enum:
- BEGINNING
- OFFSET
- TIMESTAMP
Partition:
type: object
properties:
partition:
type: integer
leader:
type: integer
replicas:
type: array
items:
$ref: '#/components/schemas/Replica'
offsetMax:
type: integer
format: int64
offsetMin:
type: integer
format: int64
required:
- topic
- partition
- offsetMax
- offsetMin
ConsumerTopicPartitionDetail:
type: object
properties:
consumerId:
type: string
topic:
type: string
host:
type: string
partition:
type: integer
currentOffset:
type: integer
format: int64
endOffset:
type: integer
format: int64
messagesBehind:
type: integer
format: int64
required:
- consumerId
ConsumerGroupDetails:
type: object
properties:
consumerGroupId:
type: string
consumers:
type: array
items:
$ref: '#/components/schemas/ConsumerTopicPartitionDetail'
required:
- consumerGroupId
Metric:
type: object
properties:
name:
type: string
canonicalName:
type: string
params:
type: string
additionalProperties:
type: string
value:
type: string
additionalProperties:
type: number
SchemaSubject:
type: object
properties:
subject:
type: string
version:
type: string
id:
type: integer
schema:
type: string
compatibilityLevel:
type: string
schemaType:
$ref: '#/components/schemas/SchemaType'
required:
- id
- subject
- version
- schema
- compatibilityLevel
- schemaType
NewSchemaSubject:
type: object
properties:
subject:
type: string
schema:
type: string
schemaType:
$ref: '#/components/schemas/SchemaType'
required:
- subject
- schema
- schemaType
CompatibilityLevel:
type: object
properties:
compatibility:
type: string
enum:
- BACKWARD
- BACKWARD_TRANSITIVE
- FORWARD
- FORWARD_TRANSITIVE
- FULL
- FULL_TRANSITIVE
- NONE
required:
- compatibility
SchemaType:
type: string
enum:
- AVRO
- JSON
- PROTOBUF
CompatibilityCheckResponse:
type: object
properties:
isCompatible:
type: boolean
required:
- isCompatible
Connect:
type: object
properties:
name:
type: string
address:
type: string
ConnectorConfig:
type: object
additionalProperties:
type: object
TaskId:
type: object
properties:
connector:
type: string
task:
type: integer
Task:
type: object
properties:
id:
$ref: '#/components/schemas/TaskId'
status:
$ref: '#/components/schemas/TaskStatus'
config:
$ref: '#/components/schemas/ConnectorConfig'
NewConnector:
type: object
properties:
name:
type: string
config:
$ref: '#/components/schemas/ConnectorConfig'
required:
- name
- config
Connector:
allOf:
- $ref: '#/components/schemas/NewConnector'
- type: object
properties:
tasks:
type: array
items:
$ref: '#/components/schemas/TaskId'
type:
type: string
enum:
- source
- sink
status:
$ref: '#/components/schemas/ConnectorStatus'
TaskStatus:
type: object
properties:
id:
type: integer
state:
type: string
enum:
- RUNNING
- FAILED
- PAUSED
- UNASSIGNED
worker_id:
type: string
trace:
type: string
ConnectorStatus:
type: object
properties:
state:
type: string
enum:
- RUNNING
- FAILED
- PAUSED
- UNASSIGNED
worker_id:
type: string
ConnectorAction:
type: string
enum:
- restart
- pause
- resume
TaskAction:
type: string
enum:
- restart
ConnectorPlugin:
type: object
properties:
class:
type: string
ConnectorPluginConfigDefinition:
type: object
properties:
name:
type: string
type:
type: string
enum:
- BOOLEAN
- CLASS
- DOUBLE
- INT
- LIST
- LONG
- PASSWORD
- SHORT
- STRING
required:
type: boolean
default_value:
type: string
importance:
type: string
enum:
- LOW
- MEDIUM
- HIGH
documentation:
type: string
group:
type: string
width:
type: string
enum:
- SHORT
- MEDIUM
- LONG
- NONE
display_name:
type: string
dependents:
type: array
items:
type: string
order:
type: integer
ConnectorPluginConfigValue:
type: object
properties:
name:
type: string
value:
type: string
recommended_values:
type: array
items:
type: string
errors:
type: array
items:
type: string
visible:
type: boolean
ConnectorPluginConfig:
type: object
properties:
definition:
$ref: '#/components/schemas/ConnectorPluginConfigDefinition'
value:
$ref: '#/components/schemas/ConnectorPluginConfigValue'
ConnectorPluginConfigValidationResponse:
type: object
properties:
name:
type: string
error_count:
type: integer
groups:
type: array
items:
type: string
configs:
type: array
items:
$ref: '#/components/schemas/ConnectorPluginConfig'