Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[droplets]: add support for droplet backup policy #1609

Merged
merged 35 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6dbdedf
[droplets]: add support for droplet backup policy
loosla Nov 5, 2024
71b3046
add internal droplets package to parse a policy
loosla Nov 5, 2024
fcd37de
fix tests, add a new test for droplet actions backup policy update
loosla Nov 5, 2024
7b9ee32
Merge branch 'main' into alushnikova/droplet-backup-policy
loosla Nov 5, 2024
869797d
add droplet backup policies into droplet create
loosla Nov 5, 2024
4e66a20
rename droplet-action command to change-backup-policy
loosla Nov 6, 2024
5a7da2c
fix tests after command renaming
loosla Nov 6, 2024
ccb5f29
add enable backups with policy to droplet actions
loosla Nov 6, 2024
a2d6ff7
add tests for EnableBackupsWithPolicy
loosla Nov 6, 2024
d9c1c1e
add enable-backups-with-policy to droplet-actions test
loosla Nov 6, 2024
cc27e0e
add get droplet backup policy
loosla Nov 6, 2024
7369111
add list droplet backup policies for all existing droplets
loosla Nov 7, 2024
0409737
add list supported droplet backup policies
loosla Nov 7, 2024
8a8a634
use a flag to apply a backup policy when enabling backups rather than…
loosla Nov 7, 2024
93be1fb
add a wait flag for a droplet change backup policy
loosla Nov 7, 2024
bc4ede2
renaming to clarify instance we refer in a loop
loosla Nov 13, 2024
3b4e2da
reduce naming for get backup policy
loosla Nov 13, 2024
b23966b
fix integration tests making backup policy optional in droplet action…
loosla Nov 13, 2024
10aabd3
group droplet backup-policies read commands under backup-policies sub…
loosla Nov 13, 2024
b796bb5
protect against panics on list for Droplets that do not have backups …
loosla Nov 13, 2024
4f6dfbd
pass droplet backup policies with the flags instead of a config file
loosla Nov 13, 2024
841b2f2
adding an empty backup policy to integration droplet action test
loosla Nov 13, 2024
8f9e0e0
add a key to the test
loosla Nov 13, 2024
d5a31a5
add a check for a default backup policy when it's missing on backup e…
loosla Nov 14, 2024
185e29b
add a comment and an integration test to enable droplet backups with …
loosla Nov 14, 2024
22c8684
add an integration test for change_backup_policy in droplet_action
loosla Nov 14, 2024
028b168
add an integration test for creating a droplet with backups enabled a…
loosla Nov 14, 2024
afd94a3
add template and format flags to droplet backup policies get; add int…
loosla Nov 14, 2024
adde2c9
rename integration tet file; add integration test for listing backup …
loosla Nov 15, 2024
4bbdfb0
add integration tests for listing droplet supported droplet backup po…
loosla Nov 15, 2024
a6c2f09
Merge branch 'main' into alushnikova/droplet-backup-policy
loosla Nov 15, 2024
4b6ac16
avoid using default values, use api defaults in droplet actions
loosla Nov 18, 2024
2aa4aa0
fix test: incorrect update in test
loosla Nov 18, 2024
614e5c7
avoid using defaults; use api defaults in droplet create
loosla Nov 18, 2024
b577a57
Merge branch 'main' into alushnikova/droplet-backup-policy
loosla Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename droplet-action command to change-backup-policy
  • Loading branch information
loosla committed Nov 6, 2024
commit 4e66a20efff328f09d9be44861ce62d097facda1
4 changes: 2 additions & 2 deletions commands/droplet_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ You can use Droplet actions to perform tasks on a Droplet, such as rebooting, re
cmdDropletActionDisableBackups.Example = `The following example disables backups on a Droplet with the ID ` + "`" + `386734086` + "`" + `: doctl compute droplet-action disable-backups 386734086`

cmdDropletActionChangeBackupPolicy := CmdBuilder(cmd, RunDropletActionChangeBackupPolicy,
"change_backup_policy <droplet-id>", "Change backup policy on a Droplet", `Changes backup policy for a Droplet with enabled backups.`, Writer,
"change-backup-policy <droplet-id>", "Change backup policy on a Droplet", `Changes backup policy for a Droplet with enabled backups.`, Writer,
displayerType(&displayers.Action{}))
AddStringFlag(cmdDropletActionChangeBackupPolicy, doctl.ArgDropletBackupPolicy, "", "", `Path to a new backup policy in JSON or YAML format. Set to "-" to read from stdin.`, requiredOpt())
// AddBoolFlag(cmdDropletActionChangeBackupPolicy, doctl.ArgCommandWait, "", false, "Wait for action to complete") // TODO: Add this flag when the doctl supports reading policy.
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 src/your-backup-policy.yaml`
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 src/your-backup-policy.yaml`

cmdDropletActionReboot := CmdBuilder(cmd, RunDropletActionReboot,
"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,
Expand Down
Loading