Skip to content

Commit 9e60f74

Browse files
author
Enda Phelan
committed
feat(kafka topic): add topic management commands
1 parent 3d36326 commit 9e60f74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2082
-1103
lines changed

.vscode/launch.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,24 @@
9090
"kafka",
9191
"topic",
9292
"create",
93-
"--name=my-topic",
94-
"--insecure"
93+
"--name=my-topic"
9594
]
9695
},
97-
{
96+
{
97+
"name": "Describe topic",
98+
"type": "go",
99+
"request": "launch",
100+
"mode": "auto",
101+
"program": "${workspaceFolder}/cmd/rhoas",
102+
"env": {},
103+
"args": [
104+
"kafka",
105+
"topic",
106+
"describe",
107+
"my-to"
108+
]
109+
},
110+
{
98111
"name": "List topics",
99112
"type": "go",
100113
"request": "launch",

docs/commands/rhoas_kafka.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ instance
4141
* link:rhoas_kafka_describe.adoc[rhoas kafka describe] - View all
4242
configuration values of a Kafka instance
4343
* link:rhoas_kafka_list.adoc[rhoas kafka list] - List all Kafka instances
44-
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, list and delete
45-
Kafka topics
44+
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, describe,
45+
update, list and delete Kafka topics
4646
* link:rhoas_kafka_use.adoc[rhoas kafka use] - Set the current Kafka
4747
instance

docs/commands/rhoas_kafka_list.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rhoas kafka list [flags]
2020
=== Examples
2121

2222
....
23-
# list all Kafka instances using the default (plain) output format
23+
# list all Kafka instances using the default output format
2424
$ rhoas kafka list
2525
2626
# list all Kafka instances using JSON as the output format
@@ -31,9 +31,9 @@ $ rhoas kafka list -o json
3131

3232
....
3333
-h, --help help for list
34-
--limit int Limit of items that should be returned from server (default 100)
35-
-o, --output string Output format of the results. Choose from ["plain" "json" "yml" "yaml"] (default "plain")
36-
--page int Page that should be returned from server
34+
--limit int Set a limit on the number of results to show (default 100)
35+
-o, --output string Output format of the results. Choose from ["json" "yml" "yaml"]
36+
--page int Set the current page of the results
3737
....
3838

3939
=== Options inherited from parent commands
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
== rhoas kafka topic
22

3-
Create, list and delete Kafka topics
3+
Create, describe, update, list and delete Kafka topics
44

55
=== Synopsis
66

7-
Create, list and delete topics for a Kafka instance.
8-
9-
=== Examples
10-
11-
....
12-
# create a topic in the current Kafka instance
13-
$ rhoas kafka topic create --name "my-example-topic"
14-
15-
# list all topics for a Kafka instance
16-
$ rhoas kafka topic list
17-
18-
# delete a topic for the current Kafka instance
19-
$ rhoas kafka topic delete --name "my-example-topic"
20-
....
7+
Create, describe, update, list and delete topics for a Kafka instance.
218

229
=== Options
2310

@@ -37,7 +24,11 @@ $ rhoas kafka topic delete --name "my-example-topic"
3724
Kafka instances
3825
* link:rhoas_kafka_topic_create.adoc[rhoas kafka topic create] - Create a
3926
Kafka topic
40-
* link:rhoas_kafka_topic_delete.adoc[rhoas kafka topic delete] - Delete
27+
* link:rhoas_kafka_topic_delete.adoc[rhoas kafka topic delete] - Delete a
4128
Kafka topic
29+
* link:rhoas_kafka_topic_describe.adoc[rhoas kafka topic describe] -
30+
Describe a Kafka topic
4231
* link:rhoas_kafka_topic_list.adoc[rhoas kafka topic list] - List Kafka
4332
topics
33+
* link:rhoas_kafka_topic_update.adoc[rhoas kafka topic update] - Update a
34+
Kafka topic

docs/commands/rhoas_kafka_topic_create.adoc

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,31 @@ Create a Kafka topic
44

55
=== Synopsis
66

7-
Create topic in the current Kafka instance
7+
Create topic in the current Kafka instance.
8+
9+
This command lets you create a topic, set a desired number of
10+
partitions, replicas and retention period or else use the default
11+
values.
812

913
....
1014
rhoas kafka topic create [flags]
1115
....
1216

17+
=== Examples
18+
19+
....
20+
# create a topic
21+
$ rhoas kafka topic create topic-1
22+
....
23+
1324
=== Options
1425

1526
....
1627
-h, --help help for create
17-
--insecure Enables insecure communication with the server. This disables verification of TLS certificates and host names.
18-
-n, --name string Topic name
19-
-p, --partitions int32 Set number of partitions (default 1)
20-
-r, --replicas int32 Set number of replicas (default 1)
28+
-o, --output string Output format of the results. Choose from ["json" "yml" "yaml"] (default "json")
29+
--partitions int32 The number of partitions in the topic (default 1)
30+
--replicas int32 The replication factor for the topic (default 1)
31+
--retention-ms int The period of time in milliseconds the broker will retain a partition log before deleting it (default -1)
2132
....
2233

2334
=== Options inherited from parent commands
@@ -28,5 +39,5 @@ rhoas kafka topic create [flags]
2839

2940
=== SEE ALSO
3041

31-
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, list and delete
32-
Kafka topics
42+
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, describe,
43+
update, list and delete Kafka topics
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
== rhoas kafka topic delete
22

3-
Delete Kafka topic
3+
Delete a Kafka topic
44

55
=== Synopsis
66

7-
Delete a topic from the current Kafka instance
7+
Delete a topic in the current Kafka instance
88

99
....
1010
rhoas kafka topic delete [flags]
1111
....
1212

13+
=== Examples
14+
15+
....
16+
# delete Kafka topic "topic-1"
17+
$ rhoas kafka delete topic-1
18+
....
19+
1320
=== Options
1421

1522
....
16-
-h, --help help for delete
17-
--insecure Enables insecure communication with the server. This disables verification of TLS certificates and host names.
18-
-n, --name string Topic name
23+
-h, --help help for delete
1924
....
2025

2126
=== Options inherited from parent commands
@@ -26,5 +31,5 @@ rhoas kafka topic delete [flags]
2631

2732
=== SEE ALSO
2833

29-
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, list and delete
30-
Kafka topics
34+
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, describe,
35+
update, list and delete Kafka topics
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
== rhoas kafka topic describe
2+
3+
Describe a Kafka topic
4+
5+
=== Synopsis
6+
7+
Print detailed configuration information for a Kafka topic
8+
9+
....
10+
rhoas kafka topic describe [flags]
11+
....
12+
13+
=== Examples
14+
15+
....
16+
# describe Kafka topic "topic-1"
17+
$ rhoas kafka describe topic-1
18+
....
19+
20+
=== Options
21+
22+
....
23+
-h, --help help for describe
24+
-o, --output string Output format of the results. Choose from ["json" "yml" "yaml"] (default "json")
25+
....
26+
27+
=== Options inherited from parent commands
28+
29+
....
30+
-d, --debug Enable debug mode
31+
....
32+
33+
=== SEE ALSO
34+
35+
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, describe,
36+
update, list and delete Kafka topics

docs/commands/rhoas_kafka_topic_list.adoc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@ List Kafka topics
44

55
=== Synopsis
66

7-
List all topics in the current Kafka instance
7+
List all topics in a Kafka instance
88

99
....
1010
rhoas kafka topic list [flags]
1111
....
1212

13+
=== Examples
14+
15+
....
16+
# list all topics
17+
$ rhoas kafka topic list
18+
19+
# list all topics as JSON
20+
$ rhoas kafka topic list -o json
21+
....
22+
1323
=== Options
1424

1525
....
1626
-h, --help help for list
17-
--insecure Enables insecure communication with the server. This disables verification of TLS certificates and host names.
18-
-o, --output string Output format of the results. Choose from ["plain" "json" "yml" "yaml"] (default "plain")
27+
-o, --output string Output format of the results. Choose from ["json" "yml" "yaml"]
1928
....
2029

2130
=== Options inherited from parent commands
@@ -26,5 +35,5 @@ rhoas kafka topic list [flags]
2635

2736
=== SEE ALSO
2837

29-
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, list and delete
30-
Kafka topics
38+
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, describe,
39+
update, list and delete Kafka topics
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
== rhoas kafka topic update
2+
3+
Update a Kafka topic
4+
5+
=== Synopsis
6+
7+
Update a topic in the current Kafka instance
8+
9+
....
10+
rhoas kafka topic update [flags]
11+
....
12+
13+
=== Examples
14+
15+
....
16+
# update the number of replicas for a topic
17+
$ rhoas kafka topic update topic-1 --replication-factor 3
18+
....
19+
20+
=== Options
21+
22+
....
23+
-h, --help help for update
24+
-o, --output string Output format of the results. Choose from ["json" "yml" "yaml"] (default "json")
25+
--partitions string The number of partitions in the topic
26+
--replicas string The replication factor for the topic
27+
--retention-ms string The period of time in milliseconds the broker will retain a partition log before deleting it
28+
....
29+
30+
=== Options inherited from parent commands
31+
32+
....
33+
-d, --debug Enable debug mode
34+
....
35+
36+
=== SEE ALSO
37+
38+
* link:rhoas_kafka_topic.adoc[rhoas kafka topic] - Create, describe,
39+
update, list and delete Kafka topics

docs/commands/rhoas_serviceaccount.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ also reset the credentials for service account.
1111

1212
....
1313
# create a service account
14-
$ rhoas serviceaccount creare
14+
$ rhoas serviceaccount create
1515
1616
# list service accounts
1717
$ rhoas serviceaccount list

0 commit comments

Comments
 (0)