Skip to content

Commit

Permalink
gscloud-server-create: add --auto-recovery flag
Browse files Browse the repository at this point in the history
Fixes #92
  • Loading branch information
bkircher committed Jan 10, 2021
1 parent dc28454 commit e65ee57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FEATURES:

* gscloud-server-create learned `--profile` flag to specify a HW profile.
* gscloud-server-create learned `--availability-zone` flag to influence a server's physical distance ([#91](https://github.com/gridscale/gscloud/issues/91)).
* gscloud-server-create also learned `--auto-recovery` flag to specify auto-recovery behavior ([#92](https://github.com/gridscale/gscloud/issues/92)).
* gscloud-server-events subcommand has been added. You can now fetch event logs for a server ([#102](https://github.com/gridscale/gscloud/issues/102)).

FIXED:
Expand Down
3 changes: 3 additions & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type serverCmdFlags struct {
plainPassword string
profile string
availabilityZone string
autoRecovery bool
}

var (
Expand Down Expand Up @@ -176,6 +177,7 @@ To create a server without any storage just omit --with-template flag:
Memory: serverFlags.memory,
HardwareProfile: profile,
AvailablityZone: serverFlags.availabilityZone,
AutoRecovery: &serverFlags.autoRecovery,
})
if err != nil {
log.Fatalf("Creating server failed: %s", err)
Expand Down Expand Up @@ -341,6 +343,7 @@ func init() {
serverCreateCmd.Flags().StringVar(&serverFlags.plainPassword, "password", "", "Plain-text password")
serverCreateCmd.Flags().StringVar(&serverFlags.profile, "profile", "q35", "Hardware profile")
serverCreateCmd.Flags().StringVar(&serverFlags.availabilityZone, "availability-zone", "", "Availability zone. One of \"a\", \"b\", \"c\". Default \"\"")
serverCreateCmd.Flags().BoolVar(&serverFlags.autoRecovery, "auto-recovery", true, "Whether to restart in case of errors")

serverSetCmd.Flags().IntVar(&serverFlags.memory, "mem", 0, "Memory (GB)")
serverSetCmd.Flags().IntVar(&serverFlags.cores, "cores", 0, "No. of cores")
Expand Down

0 comments on commit e65ee57

Please sign in to comment.