You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[droplets]: add support for droplet backup policy (#1609)
* [droplets]: add support for droplet backup policy
* add internal droplets package to parse a policy
* fix tests, add a new test for droplet actions backup policy update
* add droplet backup policies into droplet create
* rename droplet-action command to change-backup-policy
* fix tests after command renaming
* add enable backups with policy to droplet actions
* add tests for EnableBackupsWithPolicy
* add enable-backups-with-policy to droplet-actions test
* add get droplet backup policy
* add list droplet backup policies for all existing droplets
* add list supported droplet backup policies
* use a flag to apply a backup policy when enabling backups rather than use a separate droplet action for that
* add a wait flag for a droplet change backup policy
* renaming to clarify instance we refer in a loop
* reduce naming for get backup policy
* fix integration tests making backup policy optional in droplet actions enable backups
* group droplet backup-policies read commands under backup-policies sub command.
* protect against panics on list for Droplets that do not have backups enabled
* pass droplet backup policies with the flags instead of a config file
* adding an empty backup policy to integration droplet action test
* add a key to the test
* add a check for a default backup policy when it's missing on backup enabling; revert changes in integration tests
* add a comment and an integration test to enable droplet backups with backup policy
* add an integration test for change_backup_policy in droplet_action
* add an integration test for creating a droplet with backups enabled and backup policy applied
* add template and format flags to droplet backup policies get; add integration tests for droplet backup policies get
* rename integration tet file; add integration test for listing backup policies for all droplets
* add integration tests for listing droplet supported droplet backup policies
* avoid using default values, use api defaults in droplet actions
* fix test: incorrect update in test
* avoid using defaults; use api defaults in droplet create
"enable-backups <droplet-id>", "Enable backups on a Droplet", `Enables backups on a Droplet. This automatically creates and stores a disk image of the Droplet. By default, backups happen daily.`, Writer,
74
75
displayerType(&displayers.Action{}))
76
+
AddStringFlag(cmdDropletActionEnableBackups, doctl.ArgDropletBackupPolicyPlan, "", "", `Backup policy frequency plan.`)
AddBoolFlag(cmdDropletActionEnableBackups, doctl.ArgCommandWait, "", false, "Wait for action to complete")
76
-
cmdDropletActionEnableBackups.Example=`The following example enables backups on a Droplet with the ID `+"`"+`386734086`+"`"+`: doctl compute droplet-action enable-backups 386734086`
80
+
cmdDropletActionEnableBackups.Example=`The following example enables backups on a Droplet with the ID `+"`"+`386734086`+"` with a backup policy flag"+`: doctl compute droplet-action enable-backups 386734086 --backup-policy-plan weekly --backup-policy-weekday SUN --backup-policy-hour 4`
"disable-backups <droplet-id>", "Disable backups on a Droplet", `Disables backups on a Droplet. This does not delete existing backups.`, Writer,
80
84
displayerType(&displayers.Action{}))
81
85
AddBoolFlag(cmdDropletActionDisableBackups, doctl.ArgCommandWait, "", false, "Instruct the terminal to wait for the action to complete before returning access to the user")
82
86
cmdDropletActionDisableBackups.Example=`The following example disables backups on a Droplet with the ID `+"`"+`386734086`+"`"+`: doctl compute droplet-action disable-backups 386734086`
AddBoolFlag(cmdDropletActionChangeBackupPolicy, doctl.ArgCommandWait, "", false, "Wait for action to complete")
95
+
cmdDropletActionChangeBackupPolicy.Example=`The following example changes backup policy on a Droplet with the ID `+"`"+`386734086`+"`"+`: doctl compute droplet-action change-backup-policy 386734086 --backup-policy-plan weekly --backup-policy-weekday SUN --backup-policy-hour 4`
"reboot <droplet-id>", "Reboot a Droplet", `Reboots a Droplet. A reboot action is an attempt to reboot the Droplet in a graceful way, similar to using the reboot command from the Droplet's console.`, Writer,
0 commit comments