diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a70e5e4..b3fe87d64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Breaking**: `storage list` and `storage show` JSON and YAML outputs to return full API response. This changes `servers` field to contain `server` field, which in turn contains the servers. `labels` field will not be outputted if empty. - **Breaking**: `server list` and `server show` JSON and YAML outputs to return full API response. This changes field `host_id` to `host`. `nics` is replaced with `networking` subfield `interfaces`. `storage` is replaced with `storage_devices`. `labels` contain subfield `label` which in turn contains the labels. - **Breaking**: `server firewall show` JSON and YAML outputs to return full API response. This removes fields `destination` and `source` fields in favor of `[destination|source]_address_start`, `[destination|source]_address_end`, `[destination|source]_port_start` and `[destination|source]_port_end` +- **Breaking**: In JSON and YAML output of `network list` and `network show`: display full API response. Servers list will only contain server UUID and name. `ip_networks` contains subfield `ip_network` which in turn contains the labels. - In human readable output of `kubernetes show` command, show node-groups as table. Node-group details are available with `kubernetes nodegroup show` command. ## Removed diff --git a/internal/commands/network/list.go b/internal/commands/network/list.go index ee80bb118..93376807a 100644 --- a/internal/commands/network/list.go +++ b/internal/commands/network/list.go @@ -92,14 +92,18 @@ func (s *listCommand) ExecuteWithoutArguments(exec commands.Executor) (output.Ou n.Zone, }) } - return output.Table{ - Columns: []output.TableColumn{ - {Key: "uuid", Header: "UUID", Colour: ui.DefaultUUUIDColours}, - {Key: "name", Header: "Name"}, - {Key: "router", Header: "Router", Colour: ui.DefaultUUUIDColours}, - {Key: "type", Header: "Type"}, - {Key: "zone", Header: "Zone"}, + + return output.MarshaledWithHumanOutput{ + Value: filtered, + Output: output.Table{ + Columns: []output.TableColumn{ + {Key: "uuid", Header: "UUID", Colour: ui.DefaultUUUIDColours}, + {Key: "name", Header: "Name"}, + {Key: "router", Header: "Router", Colour: ui.DefaultUUUIDColours}, + {Key: "type", Header: "Type"}, + {Key: "zone", Header: "Zone"}, + }, + Rows: rows, }, - Rows: rows, }, nil } diff --git a/internal/commands/network/show.go b/internal/commands/network/show.go index 06cacbe78..2ace9fc79 100644 --- a/internal/commands/network/show.go +++ b/internal/commands/network/show.go @@ -128,7 +128,10 @@ func (s *showCommand) Execute(exec commands.Executor, arg string) (output.Output }) } - return combined, nil + return output.MarshaledWithHumanOutput{ + Value: network, + Output: combined, + }, nil } func formatShowDHCPDNS(val interface{}) (text.Colors, string, error) {