Skip to content

Commit

Permalink
fix(server): pass-through API respose in server plans marshaled output
Browse files Browse the repository at this point in the history
  • Loading branch information
kangasta committed Oct 18, 2023
1 parent 45e3d95 commit efb8ecd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ In addition, `kubernetes create` will now, by default, block all access to the c
- **Breaking**: In JSON and YAML output of `ip-address list`: return the full API response. This changes `partofplan` key to `part_of_plan` and `ptrrecord` key to `ptr_record`. The top level data-type changes from list to object.
- **Breaking**: In JSON and YAML output of `loadbalancer list`: return the full API response. This changes `state` field to `operational_state`.
- **Breaking**: In JSON and YAML output of `network list` and `network show`: return the full API response. Servers list will only contain server UUID and name. In `network list` output, the top level data-type changes from list to object.
- **Breaking**: In JSON and YAML output of `storage list` and `storage show`: return the 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 `storage list` output, the top level data-type changes from list to object.
- **Breaking**: In JSON and YAML output of `server list` and `server show`: return the 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. In `server list` output, the top level data-type changes from list to object.
- **Breaking**: In JSON and YAML output of `server firewall show`: return the 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 `server plans`: return the full API response. The top level data-type changes from list to object.
- **Breaking**: In JSON and YAML output of `storage list` and `storage show`: return the 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 `storage list` output, the top level data-type changes from list to object.
- **Breaking**: In JSON and YAML output of `zone list`: return the full API response. The top level data-type changes from list to object.
- In JSON and YAML output of `kubernetes list`: return the full API response.
- In human readable output of `kubernetes show` command, show node-groups as table. Node-group details are available with `kubernetes nodegroup show` command.
Expand Down
21 changes: 12 additions & 9 deletions internal/commands/server/plan_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ func (s *planListCommand) ExecuteWithoutArguments(exec commands.Executor) (outpu
})
}

return output.Table{
Columns: []output.TableColumn{
{Key: "name", Header: "Name"},
{Key: "cores", Header: "Cores"},
{Key: "memory", Header: "Memory"},
{Key: "storage", Header: "Storage size"},
{Key: "storage_tier", Header: "Storage tier"},
{Key: "egress_transfer", Header: "Transfer out (GiB/month)"},
return output.MarshaledWithHumanOutput{
Value: plans,
Output: output.Table{
Columns: []output.TableColumn{
{Key: "name", Header: "Name"},
{Key: "cores", Header: "Cores"},
{Key: "memory", Header: "Memory"},
{Key: "storage", Header: "Storage size"},
{Key: "storage_tier", Header: "Storage tier"},
{Key: "egress_transfer", Header: "Transfer out (GiB/month)"},
},
Rows: rows,
},
Rows: rows,
}, nil
}

0 comments on commit efb8ecd

Please sign in to comment.