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

Allow deleting multiple objects at once #115

Open
MarcHarriss opened this issue Feb 9, 2021 · 2 comments
Open

Allow deleting multiple objects at once #115

MarcHarriss opened this issue Feb 9, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@MarcHarriss
Copy link
Member

the idea would be to remove all objects in a projects like

gscloud servers power off -all
gscloud storages rm --all
gscloud servers rm --all

there should be a "are you sure" prompt
furthermore gscloud should check if all servers are off, before running

ideas?

@fkr
Copy link
Contributor

fkr commented Feb 9, 2021

I'm not a big fan of these kinds of prompts, since I issue the command, since I know what I want it to do (unix philosophy).
If we do a prompt, there needs to be a -f flag to make sure it does not prompt, if not wanted.

@bkircher bkircher changed the title add batch operation to gscloud Allow deleting multiple objects at once Feb 10, 2021
@bkircher bkircher added the enhancement New feature or request label Feb 10, 2021
@bkircher
Copy link
Contributor

bkircher commented Feb 10, 2021

My stance: just use the shell for looping over all objects, that what it is build for 🙃

But wouldn't fight this if this is getting added directly to gscloud . As long it doesn't get too crazy. Suggestion:

We call it differently then normal commands, e.g. as in Docker CLI spirit we would call this prune:

$ gscloud server prune # or 
$ gscloud storage prune

This could by default remove dangling objects (servers w/o storage, un-assigned IP addresses, storages w/o servers attached).

There we could add a --all flag that would just purge all the things in that project.

$ gscloud server prune --all  # removes all servers, storages, IP addresses

If we do a prompt, there needs to be a -f flag to make sure it does not prompt, if not wanted.

Yes. We have --force flags already in the form of gscloud-storage-set(1): For potentially destructive operations like changing storage capacities:

$ gscloud storage set --capacity 9 3fe7441e-7012-4e0c-9fd9-7a86795fd4fe
Downsizing can destroy your data. Re-run with --force to reduce storage size
from 10 GB to 9 GB

The command would do nothing unless --force is passed

$ gscloud storage set --capacity 9 --force 3fe7441e-7012-4e0c-9fd9-7a86795fd4fe

Now I just killed my server.

Okay with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants