Skip to content

Commit

Permalink
add Region and private IP to machine list, add Region to machine status
Browse files Browse the repository at this point in the history
  • Loading branch information
jipperinbham committed Apr 22, 2022
1 parent 143add5 commit 96d5c4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,8 @@ type V1Machine struct {

State string `json:"state"`

Region string `json:"region"`

ImageRef machineImageRef `json:"image_ref"`

// InstanceID is unique for each version of the machine
Expand Down
5 changes: 4 additions & 1 deletion internal/cli/internal/command/machine/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ func runMachineList(ctx context.Context) (err error) {
fmt.Sprintf("%s:%s", machine.ImageRef.Repository, machine.ImageRef.Tag),
machine.CreatedAt,
machine.State,
machine.Region,
machine.Name,
machine.PrivateIP,
})
}
_ = render.Table(io.Out, appName, rows, "ID", "Image", "Created", "State", "Name")

_ = render.Table(io.Out, appName, rows, "ID", "Image", "Created", "State", "Region", "Name", "IP Address")
}
return nil
}
1 change: 1 addition & 0 deletions internal/cli/internal/command/machine/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func runMachineStatus(ctx context.Context) error {
fmt.Fprintf(io.Out, " Machine ID: %s\n", machine.ID)
fmt.Fprintf(io.Out, " Instance ID: %s\n", machine.InstanceID)
fmt.Fprintf(io.Out, " State: %s\n", machine.State)
fmt.Fprintf(io.Out, " Region: %s\n", machine.Region)
fmt.Fprintf(io.Out, " Image: %s\n", machine.Config.Image)

return nil
Expand Down

0 comments on commit 96d5c4b

Please sign in to comment.