KafkaPilot API (0.2.0)

Download OpenAPI specification:Download

KafkaPilot API for comprehensive Kafka cluster management and monitoring

KafkaPilot is an all-in-one, container-native tool that live-samples Kafka traffic, scores partition activity, exposes management APIs (including intelligent partition redistribution) and displays everything in a modern React dashboard.

Features

  • Real-time partition activity monitoring and sampling
  • Intelligent partition redistribution with multiple strategies
  • Broker maintenance mode management
  • Topic configuration management with bulk operations
  • Cluster health monitoring
  • Reassignment monitoring and cancellation

Authentication

Currently, this API does not require authentication, yet

Health

Health check operations

Health check

Returns the health status of the KafkaPilot service

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "status": "healthy",
  • "version": "0.1.0",
  • "service": "kafkapilot"
}

Cluster

Cluster information and management

Get cluster information

Returns basic cluster information including brokers and topics

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Get comprehensive cluster information

Returns comprehensive cluster information including sampling status and detailed partition data

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Get cluster log directories

Returns log directory information for all brokers in the cluster

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": { }
}

Get cluster health

Returns cached cluster health information including broker availability and partition health

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": { }
}

Refresh cluster metadata

Manually triggers a metadata refresh for the cluster and sampler

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "timestamp": "2019-08-24T14:15:22Z",
  • "message": "string",
  • "successful_components": [
    ],
  • "failed_components": [
    ]
}

Partitions

Partition activity and monitoring

Get partition activity

Returns real-time partition activity data including sampling statistics and rates

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Redistribution

Partition redistribution operations

Redistribute topic partitions

Redistributes all partitions of a topic using the specified strategy

path Parameters
topic
required
string

Name of the topic to redistribute

Request Body schema: application/json
strategy
required
string
Enum: "ROUND_ROBIN" "RANDOM" "BALANCED" "RACK_AWARE"

Redistribution strategy to use

excludedBrokers
Array of integers <int32> [ items <int32 > ]

Broker IDs to exclude from redistribution

Responses

Request samples

Content type
application/json
{
  • "strategy": "BALANCED",
  • "excludedBrokers": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "reassignmentId": "string"
}

Redistribute single partition

Redistributes a single partition to different brokers

path Parameters
topic
required
string

Name of the topic

partition
required
integer <int32>

Partition number to redistribute

Request Body schema: application/json
targetBrokers
required
Array of integers <int32> [ items <int32 > ]

Target broker IDs for the partition

Responses

Request samples

Content type
application/json
{
  • "targetBrokers": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "reassignmentId": "string"
}

Bulk partition reassignment

Reassigns multiple partitions in a single operation

path Parameters
topic
required
string

Name of the topic

Request Body schema: application/json
description
string

Optional description for the bulk operation

required
Array of objects (RedistributePartitionRequest) non-empty

List of partition redistribution requests

Responses

Request samples

Content type
application/json
{
  • "description": "Rebalancing user-events topic for better distribution",
  • "partitions": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "reassignmentId": "string"
}

Brokers

Broker management operations

Get broker racks

Returns the rack layout for rack-aware algorithms

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Set broker maintenance mode

Marks a broker for maintenance mode and redistributes its partitions to other brokers

path Parameters
brokerId
required
integer <int32>

ID of the broker to put in maintenance mode

Request Body schema: application/json
strategy
required
string
Enum: "ROUND_ROBIN" "RANDOM" "BALANCED" "RACK_AWARE"

Redistribution strategy to use for evacuating partitions

preserveLeaders
boolean
Default: true

Whether to preserve current leaders when possible

preview
boolean
Default: false

If true, only return a preview of changes without executing them

force
boolean
Default: false

Allow maintenance even if it causes under-replicated partitions

Responses

Request samples

Content type
application/json
{
  • "strategy": "RACK_AWARE",
  • "preserveLeaders": true,
  • "preview": false,
  • "force": false
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Remove broker from maintenance mode

Removes a broker from maintenance mode

path Parameters
brokerId
required
integer <int32>

ID of the broker to remove from maintenance mode

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Topic Configuration

Topic configuration management

Get topic configuration

Returns the configuration for a specific topic

path Parameters
topic
required
string

Name of the topic

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "configs": {
    }
}

Update topic configuration

Updates the configuration for a specific topic

path Parameters
topic
required
string

Name of the topic

Request Body schema: application/json
required
object

Configuration key-value pairs to update

Responses

Request samples

Content type
application/json
{
  • "configs": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Get explicit topic configuration

Returns only explicitly set (non-default) configurations for a topic

path Parameters
topic
required
string

Name of the topic

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "configs": {
    }
}

Get default configurations

Returns cluster default topic configurations

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "defaults": {
    },
  • "message": "string"
}

Bulk update topic configurations

Updates configurations for multiple topics in a single operation

Request Body schema: application/json
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "topics": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Search topics by configuration

Searches topics based on configuration criteria

Request Body schema: application/json
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "criteria": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "topics": [
    ],
  • "totalMatches": 0
}

Proposals

Redistribution proposal operations

Generate redistribution proposal

Generates an activity-based redistribution proposal

Request Body schema: application/json
strategy
string
Enum: "activity_based" "balanced" "rack_aware"

Proposal generation strategy

targetBrokers
Array of integers <int32> [ items <int32 > ]

Target brokers for proposal (optional - if not specified, all available brokers will be used)

excludeMaintenanceBrokers
boolean
Default: true

Whether to exclude brokers in maintenance mode

Responses

Request samples

Content type
application/json
{
  • "strategy": "activity_based",
  • "targetBrokers": [
    ],
  • "excludeMaintenanceBrokers": true
}

Response samples

Content type
application/json
{
  • "success": true,
  • "proposalId": "proposal-2024-01-15-123456",
  • "proposal": {
    }
}

Apply activity-based proposal

Applies a previously generated activity-based redistribution proposal

path Parameters
proposalId
required
string

ID of the proposal to apply

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Optimization

Partition optimization recommendations

Get partition optimization

Returns partition optimization recommendations

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": { }
}

Leadership

Leader election operations

Cluster-wide preferred leader election

Triggers preferred leader election for the entire cluster or specified topics

Request Body schema: application/json
required
Array of objects

List of topics and their partitions for preferred leader election

Responses

Request samples

Content type
application/json
{
  • "topics": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Topic-scoped preferred leader election

Triggers preferred leader election for a specific topic

path Parameters
topic
required
string

Name of the topic

Request Body schema: application/json
required
Array of objects

List of topics and their partitions for preferred leader election

Responses

Request samples

Content type
application/json
{
  • "topics": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

Reassignments

Reassignment monitoring and management

Get all reassignments

Returns all partition reassignments

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Get active reassignments

Returns currently running partition reassignments

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Get reassignment history

Returns completed partition reassignments

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": [
    ]
}

Get reassignment by ID

Returns detailed status of a specific reassignment

path Parameters
id
required
string

ID of the reassignment

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}

Cancel reassignment

Cancels a running partition reassignment

path Parameters
id
required
string

ID of the reassignment to cancel

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string"
}

License

License status and management

Get license status

Returns current license state and limits

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "data": {
    }
}