cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature Request]: Add instance destruction protection option to exo compute instance create/update

Open udf2457 opened this issue 1 year ago • 6 comments
trafficstars

What feature would you like to have in the cli?

Please add instance destruction protection to exo compute instance create/update.

udf2457 avatar Apr 28 '24 14:04 udf2457

Hi, thanks for the request, this feature is planned for implementation soon. I can't give an ETA but it will be done.

sauterp avatar Apr 29 '24 06:04 sauterp

Hi @sauterp what is the current way to remove instance protection ? I couldn't find an matching parameter in the UI, the CLI doesn't allow to remove it, and trying to do it via API isn't quite simple due to mandatory signature in the AuthZ header (from what I understand).

sboulkour avatar May 15 '24 09:05 sboulkour

I ended up writing my own Go client @sboulkour. I agree it is unfortunate there is no other option, not even in the Web UI.

udf2457 avatar May 15 '24 09:05 udf2457

I did open a support case to remove the instance for now. If someone has managed to use the API with Postman I'd be happy to have a hint on how to generate properly the signature in the authZ header.

sboulkour avatar May 15 '24 09:05 sboulkour

@sboulkour all the operations in our API spec are available in the CLI under exo api, these commands aren't very polished as they are generated code.

❯ exo api remove-instance-protection -h
Remove instance destruction protection

Usage:
  exo x remove-instance-protection id [flags]

Flags:
  -h, --help   help for remove-instance-protection

Global Flags:
  -C, --config string            Specify an alternate config file [env EXOSCALE_CONFIG]
  -e, --environment string       Exoscale API environment
  -o, --output-format string     Output format [json, yaml] (default "json")
      --output-template string   Template to use if output format is "text"
  -q, --query string             Filter / project results using JMESPath
  -Q, --quiet                    Quiet mode (disable non-essential command output)
      --raw                      Output result as raw rather than pretty JSON
      --server string            Override server URL
  -A, --use-account string       Account to use in config file [env EXOSCALE_ACCOUNT]
      --verbose                  Enable verbose log output
  -z, --zone string              Exoscale zone

sauterp avatar May 15 '24 10:05 sauterp

Oooooh ! I didn't know. Thanks for the pointer. In the mean time I deleted the flag using https://github.com/exoscale/requests-exoscale-auth. But definitly note the method you provided :)

sboulkour avatar May 15 '24 12:05 sboulkour

This has been implemented here https://github.com/exoscale/cli/pull/608

pierre-emmanuelJ avatar Sep 10 '24 08:09 pierre-emmanuelJ