topic_partitions
Creates, updates, deletes, gets or lists a topic_partitions resource.
Overview
| Name | topic_partitions |
| Type | Resource |
| Id | confluent.kafka.topic_partitions |
Fields
The following fields are returned by SELECT queries:
- get_kafka_partition
- list_kafka_partitions
The partition
| Name | Datatype | Description |
|---|---|---|
cluster_id | string | |
partition_id | integer | |
topic_name | string | |
kind | string | |
leader | object | |
metadata | object | |
reassignment | object | |
replicas | object |
The list of partitions.
| Name | Datatype | Description |
|---|---|---|
cluster_id | string | |
partition_id | integer | |
topic_name | string | |
kind | string | |
leader | object | |
metadata | object | |
reassignment | object | |
replicas | object |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_kafka_partition | select | cluster_id, topic_name, partition_id, kafka_endpoint_id, region, cloud_provider | Return the partition with the given partition_id. | |
list_kafka_partitions | select | cluster_id, topic_name, kafka_endpoint_id, region, cloud_provider | Return 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.
| Name | Datatype | Description |
|---|---|---|
cloud_provider | string | Cloud provider, lowercase: aws, gcp, or azure (from the cluster spec.cloud). (default: cloud) |
cluster_id | string | The Kafka cluster ID. (example: cluster-1) |
kafka_endpoint_id | string | Per-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_id | integer | The partition ID. (example: 0) |
region | string | Cloud region the cluster runs in, e.g. ap-southeast-2 (from the cluster spec.region). (default: region) |
topic_name | string | The topic name. (example: topic-1) |
SELECT examples
- get_kafka_partition
- list_kafka_partitions
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
;
Return the list of partitions that belong to the specified topic.
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 kafka_endpoint_id = '{{ kafka_endpoint_id }}' -- required
AND region = '{{ region }}' -- required
AND cloud_provider = '{{ cloud_provider }}' -- required
;