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

[Files] File service bulk delete #154286

Closed
jonathan-buttner opened this issue Apr 3, 2023 · 6 comments · Fixed by #155628
Closed

[Files] File service bulk delete #154286

jonathan-buttner opened this issue Apr 3, 2023 · 6 comments · Fixed by #155628
Assignees
Labels
Feature:Cases Cases feature feature:Files NeededFor:ResponseOps Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@jonathan-buttner
Copy link
Contributor

Cases adding a feature to allow users to attach files to a case. A user will be able to delete files individually or delete an entire case and all files associated with it. Currently, the file service does not provide a bulk deletion API per file kind. The file service does provide a bulk deletion for admin users that have the file management role but a cases user may not have this configured.

Would it be possible to have a bulk deletion api that accepts an array of file kinds? If that's not feasible having a bulk deletion api per file kind would also help.

@jonathan-buttner jonathan-buttner added Feature:Cases Cases feature Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) feature:Files NeededFor:ResponseOps labels Apr 3, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@petrklapka
Copy link
Member

@sixstringcode - Let's get more detail about what the ask is. Clarify scope of delete (does it tie to a specific case, or is it a global delete request etc.)

@vadimkibana
Copy link
Contributor

@jonathan-buttner just to clarify, once a case is deleted, you would like to also delete all the files associated with it. So, Kibana server receives a case deletion request and it wants to initiate file deletion from the server-side, right now there is ability to delete one file at-a-time, but your request is to provide also an ability for a bulk delete?

@vadimkibana
Copy link
Contributor

vadimkibana commented Apr 19, 2023

Basically, right now there is a delete() method, which accepts a single { id } param, we would need to extend it to:

  • Expose bulkDelete()
  • Which accepts a list of { ids: string[] }
  • Should execute multiple deletes in parallel
  • Should continue processing even if some delete operation fails
  • Should return a list of errors, if any
  • Should limit concurrency, to say 5 deletes in-flight

@jonathan-buttner
Copy link
Contributor Author

@jonathan-buttner just to clarify, once a case is deleted, you would like to also delete all the files associated with it. So, Kibana server receives a case deletion request and it wants to initiate file deletion from the server-side, right now there is ability to delete one file at-a-time, but your request is to provide also an ability for a bulk delete?

Yep, that's correct.

Are you thinking that the bulk delete would be for a single file kind or would it not need the file kind at all?

Cases has a bulk deletion of cases and technically a user could delete an observability case and a security case at the same time which would result in bulk deleting multiple file kinds. This is unlikely though as the cases UI only allows bulk deletion within a single plugin.

Basically, right now there is a delete() method, which accepts a single { id } param, we would need to extend it to:

All those items sound great!

@vadimkibana vadimkibana changed the title File service bulk delete [Files] File service bulk delete Apr 24, 2023
dmlemeshko pushed a commit to dmlemeshko/kibana that referenced this issue Apr 26, 2023
## Summary

Closes elastic#154286


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Cases Cases feature feature:Files NeededFor:ResponseOps Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants