danube-admin: Topics Commands
The danube-admin-cli tool provides commands to manage and view information about topics in your Danube cluster. Below is the documentation for the commands related to topics.
Commands
danube-admin-cli topics list NAMESPACE
Get the list of topics in a specified namespace.
Usage:
Description:
This command retrieves and displays all topics within a specified namespace. Replace NAMESPACE with the name of the namespace you want to query.
Use --output json to print JSON instead of plain text.
Example Output:
danube-admin-cli topics create TOPIC
Create a topic (non‑partitioned or partitioned). You can also set schema and dispatch strategy.
Usage:
danube-admin-cli topics create TOPIC [--namespace NS] [--partitions N] \
[-s, --schema String|Bytes|Int64|Json] [--schema-file PATH | --schema-data JSON] \
[--dispatch-strategy non_reliable|reliable]
Description:
This command creates a new topic. TOPIC accepts either /namespace/topic or topic (when --namespace is provided). Use --partitions to create a partitioned topic. For Json schema, provide the schema via --schema-file or --schema-data.
Example Output:
danube-admin-cli topics delete TOPIC
Delete a specified topic.
Usage:
Description:
This command deletes the specified topic. TOPIC accepts /namespace/topic or topic with --namespace.
Example Output:
danube-admin-cli topics subscriptions TOPIC
Get the list of subscriptions on a specified topic.
Usage:
Description:
This command retrieves and displays all subscriptions associated with a specified topic. TOPIC accepts /namespace/topic or topic with --namespace. Use --output json for JSON output.
Example Output:
danube-admin-cli topics describe TOPIC
Describe a topic: schema and subscriptions.
Usage:
Description:
Shows topic name, schema (pretty-printed when JSON), and subscriptions. TOPIC accepts /namespace/topic or topic with --namespace.
danube-admin-cli topics unsubscribe --subscription SUBSCRIPTION TOPIC
Delete a subscription from a topic.
Usage:
Description:
This command deletes a subscription from a specified topic. TOPIC accepts /namespace/topic or topic with --namespace.
Example Output:
Error Handling
If there is an issue with connecting to the cluster or processing the request, the CLI will output an error message. Ensure your Danube cluster is running and accessible, and check your network connectivity.
Examples
Here are a few example commands for quick reference:
- List topics in a namespace:
- Create a topic:
- Delete a topic:
- Unsubscribe from a topic:
- List subscriptions for a topic:
For more detailed information or help with the danube-admin-cli, you can use the --help flag with any command.
Example: