diff --git a/CHANGELOG.md b/CHANGELOG.md index a678607b9..78a70e5e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - **Breaking**: In JSON and YAML output of `loadbalancer list`: display full API response. This changes `state` field to `operational_state`. - **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. -- In human readable output of `kubernetes show` command, show node-groups as table. Node-group datails are available with `kubernetes nodegroup show` command. +- **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` +- In human readable output of `kubernetes show` command, show node-groups as table. Node-group details are available with `kubernetes nodegroup show` command. ## Removed - **Breaking**: Remove `database connection list` and `database connection cancel` commands in favor of `database session` counterparts diff --git a/internal/commands/server/firewall/show.go b/internal/commands/server/firewall/show.go index 1852cbdc4..924a74102 100644 --- a/internal/commands/server/firewall/show.go +++ b/internal/commands/server/firewall/show.go @@ -99,28 +99,32 @@ func (s *showCommand) Execute(exec commands.Executor, arg string) (output.Output }, }) } - return output.Combined{ - output.CombinedSection{ - Key: "rules", - Title: "Firewall rules", - Contents: output.Table{ - Columns: []output.TableColumn{ - {Key: "index", Header: "#"}, - {Key: "action", Header: "Action", Format: actionFormat}, - {Key: "source", Header: "Source", Format: addressFormat}, - {Key: "destination", Header: "Destination", Format: addressFormat}, - {Key: "direction", Header: "Dir"}, - {Key: "protocol", Header: "Proto", Format: protoFormat}, + + return output.MarshaledWithHumanOutput{ + Value: rules, + Output: output.Combined{ + output.CombinedSection{ + Key: "rules", + Title: "Firewall rules", + Contents: output.Table{ + Columns: []output.TableColumn{ + {Key: "index", Header: "#"}, + {Key: "action", Header: "Action", Format: actionFormat}, + {Key: "source", Header: "Source", Format: addressFormat}, + {Key: "destination", Header: "Destination", Format: addressFormat}, + {Key: "direction", Header: "Dir"}, + {Key: "protocol", Header: "Proto", Format: protoFormat}, + }, + Rows: fwRows, }, - Rows: fwRows, }, - }, - output.CombinedSection{ - Contents: output.Details{Sections: []output.DetailSection{ - {Rows: []output.DetailRow{ - {Key: "enabled", Title: "Enabled", Value: server.Firewall == "on", Format: format.Boolean}, + output.CombinedSection{ + Contents: output.Details{Sections: []output.DetailSection{ + {Rows: []output.DetailRow{ + {Key: "enabled", Title: "Enabled", Value: server.Firewall == "on", Format: format.Boolean}, + }}, }}, - }}, + }, }, }, nil } diff --git a/internal/commands/server/list.go b/internal/commands/server/list.go index 21040f6d2..ca10abbb6 100644 --- a/internal/commands/server/list.go +++ b/internal/commands/server/list.go @@ -112,9 +112,12 @@ func (ls *listCommand) ExecuteWithoutArguments(exec commands.Executor) (output.O } } - return output.Table{ - Columns: columns, - Rows: rows, + return output.MarshaledWithHumanOutput{ + Value: servers, + Output: output.Table{ + Columns: columns, + Rows: rows, + }, }, nil } diff --git a/internal/commands/server/show.go b/internal/commands/server/show.go index bbc6b7749..30e0a06b7 100644 --- a/internal/commands/server/show.go +++ b/internal/commands/server/show.go @@ -239,7 +239,10 @@ func (s *showCommand) Execute(exec commands.Executor, uuid string) (output.Outpu }) } - return combined, nil + return output.MarshaledWithHumanOutput{ + Value: server, + Output: combined, + }, nil } func formatShowIPAddresses(val interface{}) (text.Colors, string, error) {