From 78fbc05d3521b463714308b70740128507a832f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Sep 2025 05:13:06 +0000 Subject: [PATCH 1/2] Initial plan From a5a9de366a2520b49396d1832bfd1273fb19cc76 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 30 Sep 2025 05:18:02 +0000 Subject: [PATCH 2/2] Display cores, memory, and capacity in gscloud info command Co-authored-by: fabiante <7669818+fabiante@users.noreply.github.com> --- cmd/info.go | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/cmd/info.go b/cmd/info.go index d7f8bfed..4f9df96a 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -30,11 +30,11 @@ Show summary for a given account: API token URL https://api.gridscale.io Getting information about used resources… - OBJECT COUNT - Platform services 0 - Servers 18 - Storages 24 - IP addresses 2 + OBJECT COUNT CORES MEMORY (GiB) CAPACITY (GiB) + Platform services 0 - - - + Servers 18 36 72 - + Storages 24 - - 240 + IP addresses 2 - - - `, RunE: func(cmd *cobra.Command, args []string) error { type output struct { @@ -156,14 +156,28 @@ Show summary for a given account: out := new(bytes.Buffer) if !rootFlags.json { - heading := []string{"object", "count"} + heading := []string{"object", "count", "cores", "memory (GiB)", "capacity (GiB)"} var rows [][]string for v := range ch { if v.Err != nil { return v.Err } count := v.Agg["count"].(int) - rows = append(rows, []string{v.Obj, strconv.Itoa(count)}) + cores := "-" + memory := "-" + capacity := "-" + + if val, ok := v.Agg["cores"]; ok { + cores = strconv.Itoa(val.(int)) + } + if val, ok := v.Agg["memory"]; ok { + memory = strconv.Itoa(val.(int)) + } + if val, ok := v.Agg["capacity"]; ok { + capacity = strconv.Itoa(val.(int)) + } + + rows = append(rows, []string{v.Obj, strconv.Itoa(count), cores, memory, capacity}) } render.AsTable(out, heading, rows, renderOpts) } else {