Skip to content

Commit

Permalink
Get zone for cluster nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Oct 6, 2020
1 parent 9a04e73 commit 38ed959
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type ClusterNode struct {
SolitarySegmentSize float64
IsAvailable bool
LastHeartbeat string
// Zone holds the availability zone as configured in the `ZONE` configuration of the Humio server.
Zone string
}

type IngestPartition struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/humioctl/cluster_nodes_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ func newClusterNodesListCmd() *cobra.Command {

rows := make([][]string, len(nodes))
for i, node := range nodes {
rows[i] = []string{strconv.Itoa(node.Id), node.Name, strconv.FormatBool(node.CanBeSafelyUnregistered)}
rows[i] = []string{strconv.Itoa(node.Id), node.Name, strconv.FormatBool(node.CanBeSafelyUnregistered), node.Zone}
}

w := tablewriter.NewWriter(cmd.OutOrStdout())
w.SetHeader([]string{"ID", "Name", "Can be safely unregistered"})
w.SetHeader([]string{"ID", "Name", "Can be safely unregistered", "Availability Zone"})
w.AppendBulk(rows)
w.SetBorder(false)

Expand Down
1 change: 1 addition & 0 deletions cmd/humioctl/cluster_nodes_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func printClusterNodeInfo(cmd *cobra.Command, node api.ClusterNode) {
{"Solitary segment size", ByteCountDecimal(int64(node.SolitarySegmentSize))},
{"Is available", strconv.FormatBool(node.IsAvailable)},
{"Last heartbeat", node.LastHeartbeat},
{"Availability Zone", node.Zone},
}

w := tablewriter.NewWriter(cmd.OutOrStdout())
Expand Down

0 comments on commit 38ed959

Please sign in to comment.