godo icon indicating copy to clipboard operation
godo copied to clipboard

feat: recovery mode

Open sergelogvinov opened this issue 4 years ago • 2 comments

Add capabilities to switch Droplet to recovery mode.

godo.Recovery(ctx, 3164444, true)

This method has in the console already.

sergelogvinov avatar Sep 13 '21 20:09 sergelogvinov

Yes, of course. Thank you)

sergelogvinov avatar Sep 14 '21 14:09 sergelogvinov

Unfortunately, I was mistaken here.

Web console uses API v1, godo - v2, method set_boot_device is not working as I expected. This is not documented feature. And I do not know the second parameter. {'local_disk':false} API-v2 not supported.

If I call api /v2/droplets/1/actions with body {"type": "set_boot_device",'local_disk':false} API receives the request and send notice to the web-console that boot-disk was changed. But nothing has happened.

I am trying to add RecoveryMode to the hashicorp packer provider. https://github.com/sergelogvinov/packer-plugin-digitalocean/commit/bfec3b82c7eed0c01b5992661c8502bda1dffa0d

Can you help me. What is the second parameter of method set_boot_device? @ChiefMateStarbuck

Thank you.

sergelogvinov avatar Sep 27 '21 17:09 sergelogvinov

hello @sergelogvinov, i believe {"type": "set_boot_device"} should do the trick.

As recovery is not an officially supported action, we cannot merge this PR.

A workaround would be to make a custom function that implements the recovery functionality.

Does this help?

ChiefMateStarbuck avatar Apr 13 '23 23:04 ChiefMateStarbuck