Skip to content
New issue

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

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

Already on GitHub? # to your account

Introduce delete subcommand to hcloud all #689

Open
kranurag7 opened this issue Feb 6, 2024 · 3 comments
Open

Introduce delete subcommand to hcloud all #689

kranurag7 opened this issue Feb 6, 2024 · 3 comments

Comments

@kranurag7
Copy link
Contributor

TL;DR

As a User, I have the use case of deleting all the resources in one project in one go.
Given we don't have projects API available in hcloud-go or project subcommand in hcloud CLI. I think we can implement it under hcloud all

Expected behavior

hcloud all delete 
< prompt: Do you really want to delete everything [y/n]? >
@kranurag7
Copy link
Contributor Author

@apricote Do we want to implement it? If yes, I can give it an attempt.

I'm not very familiar with the code here so if you think that this will be not be possible to implement or requires some big refactoring then please let me know.

@phm07
Copy link
Contributor

phm07 commented Mar 5, 2024

I'm not sure if it is a good idea to add this to the CLI, as this command is very dangerous and probably not that often used. Also it's not clear what should be deleted. All resources, even the free ones (like SSH Keys, Placement Groups and Firewalls)? Or only paid resources? How are protected resources handled? What about deletion order (Volumes might be attached to servers etc.)? Maybe we can get a third opinion on this.

For now I'd suggest a solution like this:

hcloud server list -o=noheader -o=columns=name | xargs -L1 -I{} hcloud server delete {}

@phm07 phm07 added the feature label Mar 8, 2024
@jooola
Copy link
Member

jooola commented Apr 4, 2024

With 3b896fe being released, it is now easier to delete multiple resources at once.

I propose to let this feature request open and wait until enough user have expressed their interest to reconsider the implementation of such feature.

@jooola jooola added the pinned label Apr 4, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants