-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
API support for bulk object deletion #3436
Comments
This has been in the back of my mind for a while, and I am surprised it has not come up before now. As we look to make UI improvements down the road, this will be needed. We should be able to do this with a non-detail action route on our modified ModelViewSet class. I would want to be able to pass a list of PKs or a list of objects that use the same queryset field lookup logic we implemented not long ago, as the quest body. For example for sites, you could pass either:
Or
|
I also have a requirement for this. I'm pulling data from Azure and want my netbox to match my Azure estate exactly. So if someone deletes a vnet in Azure, that vnet also needs to be removed in Netbox. So I would like to run my pipeline which will initially bulk delete everything and then add the current state of Azure |
I've made good progress on this in the branch
|
After a lot of digging, the sticking point seems to be the At present, the only workaround seems to be to replicate both the |
I figured out a workaround by monkey-patching DRF's |
#3436: Support for bulk deletion via REST API
Environment
Proposed Functionality
Allow bulk deletion of sites and devices (preferably anything) through API end-point.
Use Case
We have a use case that requires bulk deletion of sites and devices for automated deployment and testing of a Netbox instance. Currently, we have to iterate through the list of objects and delete them 1 by 1 (i.e. 1 HTTP request per device/site/whatever), this can take upwards of minutes. We can bulk create just fine (which reduced time to finish by a lot), but can't bulk delete. The GUI has the ability, but there isn't an API endpoint to do so.
The text was updated successfully, but these errors were encountered: