Skip to content

Commit

Permalink
fix(lb): show full API response in marshaled outputs (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangasta authored Oct 16, 2023
1 parent 34d798e commit 9195910
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `database session cancel` for cancelling an active database session

### Changed
- **Breaking**: In JSON and YAML output of `loadbalancer list`: display full API response. This changes `state` field to `operational_state`.
- In human readable output of `kubernetes show` command, show node-groups as table. Node-group datails are available with `kubernetes nodegroup show` command.

## Removed
Expand Down
19 changes: 11 additions & 8 deletions internal/commands/loadbalancer/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ func (s *listCommand) ExecuteWithoutArguments(exec commands.Executor) (output.Ou
})
}

return output.Table{
Columns: []output.TableColumn{
{Key: "uuid", Header: "UUID", Colour: ui.DefaultUUUIDColours},
{Key: "name", Header: "Name"},
{Key: "plan", Header: "Plan"},
{Key: "zone", Header: "Zone"},
{Key: "state", Header: "State", Format: format.LoadBalancerState},
return output.MarshaledWithHumanOutput{
Value: loadbalancers,
Output: output.Table{
Columns: []output.TableColumn{
{Key: "uuid", Header: "UUID", Colour: ui.DefaultUUUIDColours},
{Key: "name", Header: "Name"},
{Key: "plan", Header: "Plan"},
{Key: "zone", Header: "Zone"},
{Key: "operational_state", Header: "State", Format: format.LoadBalancerState},
},
Rows: rows,
},
Rows: rows,
}, nil
}

0 comments on commit 9195910

Please sign in to comment.