Skip to main content

topics

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

Overview

Nametopics
TypeResource
Iddigitalocean.databases.topics

Fields

NameDatatypeDescription
column_anon``

Methods

NameAccessible byRequired ParamsDescription
databases_get_kafka_topicSELECTdatabase_cluster_uuid, topic_nameTo retrieve a given topic by name from the set of a Kafka cluster's topics, send a GET request to /v2/databases/$DATABASE_ID/topics/$TOPIC_NAME. The result will be a JSON object with a topic key.
databases_list_kafka_topicsSELECTdatabase_cluster_uuidTo list all of a Kafka cluster's topics, send a GET request to /v2/databases/$DATABASE_ID/topics. The result will be a JSON object with a topics key.
databases_create_kafka_topicINSERTdatabase_cluster_uuidTo create a topic attached to a Kafka cluster, send a POST request to /v2/databases/$DATABASE_ID/topics. The result will be a JSON object with a topic key.
databases_delete_kafka_topicDELETEdatabase_cluster_uuid, topic_nameTo delete a single topic within a Kafka cluster, send a DELETE request to /v2/databases/$DATABASE_ID/topics/$TOPIC_NAME. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
databases_update_kafka_topicEXECdatabase_cluster_uuid, topic_nameTo update a topic attached to a Kafka cluster, send a PUT request to /v2/databases/$DATABASE_ID/topics/$TOPIC_NAME. The result will be a JSON object with a topic key.

SELECT examples

To list all of a Kafka cluster's topics, send a GET request to /v2/databases/$DATABASE_ID/topics. The result will be a JSON object with a topics key.

SELECT
column_anon
FROM digitalocean.databases.topics
WHERE database_cluster_uuid = '{{ database_cluster_uuid }}';

INSERT example

Use the following StackQL query and manifest file to create a new topics resource.

/*+ create */
INSERT INTO digitalocean.databases.topics (
data__name,
data__replication_factor,
data__partition_count,
data__config,
database_cluster_uuid
)
SELECT
'{{ name }}',
'{{ replication_factor }}',
'{{ partition_count }}',
'{{ config }}',
'{{ database_cluster_uuid }}'
;

DELETE example

Deletes the specified topics resource.

/*+ delete */
DELETE FROM digitalocean.databases.topics
WHERE database_cluster_uuid = '{{ database_cluster_uuid }}'
AND topic_name = '{{ topic_name }}';