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

Cloud Storage Delete all files with prefix #680

Closed
javorosas opened this issue Jun 19, 2015 · 3 comments · Fixed by #698
Closed

Cloud Storage Delete all files with prefix #680

javorosas opened this issue Jun 19, 2015 · 3 comments · Fixed by #698
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: question Request for information or clarification. Not an issue.

Comments

@javorosas
Copy link

It would be nice if there was a bulk delete for files that satisfy a query in a bucket. Something like:

myBucket.deleteFiles({ prefix: 'myDirectory/' }, callback);
@jgeewax
Copy link
Contributor

jgeewax commented Jun 19, 2015

Since there's no API call for this, it'd really be a shortcut for...

bucket.getFiles({ prefix: 'directory/'}, function(err, files, ...) {
  for (var i in files) {
    files[i].delete();
  }
});

which could be super misleading about what's actually happening, and might fail half-way through (it wouldn't be an atomic operation). That said, I'll leave this open for discussion...

/cc @stephenplusplus : This (to me) feels like the whole "delete bucket even if it isn't empty" thing where people are going to do it, so we might as well help them do it right (and then if we add an API call to do such a thing, we can swap it for that under the hood without anyone caring).

/cc @Capstan : Any chance we're going to add a long-running operation to delete multiple files in a single request using the same query parameters we provide to Objects:list?

@jgeewax jgeewax added type: question Request for information or clarification. Not an issue. api: storage Issues related to the Cloud Storage API. labels Jun 19, 2015
@stephenplusplus
Copy link
Contributor

I think this is a good idea. Will PR.

@stephenplusplus stephenplusplus self-assigned this Jun 22, 2015
@Capstan
Copy link

Capstan commented Jun 22, 2015

@jgeewax Support for additional long-running operations is on our roadmap, yes. As for what the method looks like is still undecided. It may not look like list objects at all. It may cleave more to lifecycle management instead. If you have some specific use cases / design goals in mind, it'd be helpful. (e.g., do you care about people adding objects after the operation starts being deleted or not?)

sofisl added a commit that referenced this issue Jan 10, 2023
* chore(deps): upgrade gapic-generator-java to 2.4.1

PiperOrigin-RevId: 422607515

Source-Link: googleapis/googleapis@ba2ffd6

Source-Link: googleapis/googleapis-gen@73ba4ad
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Jan 24, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/1375dc8f-6e92-47e5-b704-19ee285b9aaf/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 345596855
Source-Link: googleapis/googleapis@d189e87
sofisl pushed a commit that referenced this issue Jan 25, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/1375dc8f-6e92-47e5-b704-19ee285b9aaf/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 345596855
Source-Link: googleapis/googleapis@d189e87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants