topics
Creates, updates, deletes, gets or lists a topics
resource.
Overview
Name | topics |
Type | Resource |
Id | confluent.kafka.topics |
Fields
Name | Datatype | Description |
---|---|---|
authorized_operations | array | |
cluster_id | string | |
configs | object | |
is_internal | boolean | |
kind | string | |
metadata | object | |
partition_reassignments | object | |
partitions | object | |
partitions_count | integer | |
replication_factor | integer | |
topic_name | string |
Methods
SELECT
examples
Return the list of topics that belong to the specified Kafka cluster.
SELECT
authorized_operations,
cluster_id,
configs,
is_internal,
kind,
metadata,
partition_reassignments,
partitions,
partitions_count,
replication_factor,
topic_name
FROM confluent.kafka.topics
WHERE cluster_id = '{{ cluster_id }}';
INSERT
example
Use the following StackQL query and manifest file to create a new topics
resource.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO confluent.kafka.topics (
data__topic_name,
data__partitions_count,
data__replication_factor,
data__configs,
data__validate_only,
cluster_id
)
SELECT
'{{ topic_name }}',
'{{ partitions_count }}',
'{{ replication_factor }}',
'{{ configs }}',
'{{ validate_only }}',
'{{ cluster_id }}'
;
/*+ create */
INSERT INTO confluent.kafka.topics (
data__topic_name,
cluster_id
)
SELECT
'{{ topic_name }}',
'{{ cluster_id }}'
;
- name: topics
props:
- name: cluster_id
value: string
- name: data__topic_name
value: string
- name: topic_name
value: string
- name: partitions_count
value: integer
- name: replication_factor
value: integer
- name: configs
value: array
props:
- name: name
value: string
- name: value
value: string
- name: validate_only
value: boolean
UPDATE
example
Updates a topics
resource.
/*+ update */
UPDATE confluent.kafka.topics
SET
partitions_count = '{{ partitions_count }}'
WHERE
cluster_id = '{{ cluster_id }}'
AND topic_name = '{{ topic_name }}'
AND data__partitions_count = '{{ data__partitions_count }}';
DELETE
example
Deletes the specified topics
resource.
/*+ delete */
DELETE FROM confluent.kafka.topics
WHERE cluster_id = '{{ cluster_id }}'
AND topic_name = '{{ topic_name }}';