Skip to content

Commit

Permalink
Add server.image to server describe (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetechnick authored and thcyron committed Jan 22, 2018
1 parent 02630c9 commit db33b5e
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[[constraint]]
name = "github.com/hetznercloud/hcloud-go"
version = "1.0.0"
version = "1.1.0"

[[constraint]]
name = "github.com/pelletier/go-toml"
Expand Down
21 changes: 21 additions & 0 deletions server_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ func runServerDescribe(cli *CLI, cmd *cobra.Command, args []string) error {
} else {
fmt.Printf(" No Floating IPs\n")
}
fmt.Printf("Image:\n")
if server.Image != nil {
image := server.Image
fmt.Printf(" ID:\t\t%d\n", image.ID)
fmt.Printf(" Type:\t\t%s\n", image.Type)
fmt.Printf(" Status:\t%s\n", image.Status)
fmt.Printf(" Name:\t\t%s\n", na(image.Name))
fmt.Printf(" Description:\t%s\n", image.Description)
if image.ImageSize != 0 {
fmt.Printf(" Image size:\t%.1f GB\n", image.ImageSize)
} else {
fmt.Printf(" Image size:\t%s\n", na(""))
}
fmt.Printf(" Disk size:\t%.0f GB\n", image.DiskSize)
fmt.Printf(" Created:\t%s (%s)\n", image.Created, humanize.Time(image.Created))
fmt.Printf(" OS flavor:\t%s\n", image.OSFlavor)
fmt.Printf(" OS version:\t%s\n", na(image.OSVersion))
fmt.Printf(" Rapid deploy:\t%s\n", yesno(image.RapidDeploy))
} else {
fmt.Printf(" No Image\n")
}

fmt.Printf("Traffic:\n")
fmt.Printf(" Outgoing:\t%v\n", humanize.Bytes(server.OutgoingTraffic))
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/hetznercloud/hcloud-go/hcloud/hcloud.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/hetznercloud/hcloud-go/hcloud/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/hetznercloud/hcloud-go/hcloud/schema_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/hetznercloud/hcloud-go/hcloud/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db33b5e

Please sign in to comment.