[CLI-1884] show total topic count of cluster when run kafka cluster describe/update #1438
[CLI-1884] show total topic count of cluster when run kafka cluster describe/update #1438
kafka cluster describe/update #1438Conversation
|
Why are we putting this behind the |
would this be a breaking change? if not and if we don't mind the time consumed on one extra rest call, then sure we can show it all the time |
kafka cluster describe --all kafka cluster describe
Updated to always print topic count. |
| func (c *clusterCommand) getTotalTopicCountForKafkaCluster(cluster *cmkv2.CmkV2Cluster) (int32, error) { | ||
| lkc := *cluster.Id | ||
| if kafkaREST, _ := c.GetKafkaREST(); kafkaREST != nil { | ||
| topicGetResp, httpResp, err := kafkaREST.CloudClient.ListKafkaTopics(lkc) |
There was a problem hiding this comment.
Is this the same endpoint we call for confluent kafka topic list? Maybe we should write a plugin called confluent-kafka-topic-count.sh that simply runs confluent kafka topic list -o json | grep name | wc -l.
I think it would be wise to avoid making more than one API call per command if we can avoid it, as you mentioned above. I'd like to see what Ethan Ruhe (@ethanruhe) thinks when he gets back.
There was a problem hiding this comment.
Talked to David and Ethan. agreed that one more call is fine. Ideally we only want 1, and when we need ~5 calls it's better to make it a plugin
kafka cluster describe kafka cluster describe
kafka cluster describe kafka cluster describe/update
Checklist
What
show total topic count of a cluster in an environment when run
kafka cluster describe/update.References
Test & Review