Skip to main content

topic_partitions

Creates, updates, deletes, gets or lists a topic_partitions resource.

Overview

Nametopic_partitions
TypeResource
Idconfluent.kafka.topic_partitions

Fields

The following fields are returned by SELECT queries:

The partition

NameDatatypeDescription
cluster_idstring
partition_idinteger
topic_namestring
kindstring
leaderobject
metadataobject
reassignmentobject
replicasobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_kafka_partitionselectcluster_id, topic_name, partition_id, kafka_endpoint_id, region, cloud_providerReturn the partition with the given partition_id.
list_kafka_partitionsselectcluster_id, topic_name, kafka_endpoint_id, region, cloud_providerReturn the list of partitions that belong to the specified topic.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
cloud_providerstringCloud provider, lowercase: aws, gcp, or azure (from the cluster spec.cloud). (default: cloud)
cluster_idstringThe Kafka cluster ID. (example: cluster-1)
kafka_endpoint_idstringPer-cluster Kafka REST endpoint ID (the pkc-* host prefix from the Confluent UI Cluster -> Overview -> REST endpoint, or extract from confluent.managed_kafka_clusters.clusters spec.http_endpoint). (default: pkc-00000)
partition_idintegerThe partition ID. (example: 0)
regionstringCloud region the cluster runs in, e.g. ap-southeast-2 (from the cluster spec.region). (default: region)
topic_namestringThe topic name. (example: topic-1)

SELECT examples

Return the partition with the given partition_id.

SELECT
cluster_id,
partition_id,
topic_name,
kind,
leader,
metadata,
reassignment,
replicas
FROM confluent.kafka.topic_partitions
WHERE cluster_id = '{{ cluster_id }}' -- required
AND topic_name = '{{ topic_name }}' -- required
AND partition_id = '{{ partition_id }}' -- required
AND kafka_endpoint_id = '{{ kafka_endpoint_id }}' -- required
AND region = '{{ region }}' -- required
AND cloud_provider = '{{ cloud_provider }}' -- required
;