Provide a method to recursively delete objects #895

Closed
opened 2025-12-29 16:26:47 +01:00 by adam · 3 comments
Owner

Originally created by @zevlag on GitHub (May 1, 2017).

Issue type: Feature Request

NetBox version: v2.0.0-dev: de58d0e

I attempted to delete a populated rack and it failed. I would love to be able to delete a Rack, and all associated objects. It would be awesome if I could select how far down to recurse, ie:

You are deleting this rack, would you also like to delete associated:
[ ] Devices
[ ] IP Addresses

This could also be available at other levels, such as Site or Tenant, and include other objects.

We build temporary racks and devices and move them around while in the planning stages, and this would make cleanup much easier.

Originally created by @zevlag on GitHub (May 1, 2017). ### Issue type: Feature Request NetBox version: v2.0.0-dev: de58d0e I attempted to delete a populated rack and it failed. I would love to be able to delete a Rack, and all associated objects. It would be awesome if I could select how far down to recurse, ie: You are deleting this rack, would you also like to delete associated: [ ] Devices [ ] IP Addresses This could also be available at other levels, such as Site or Tenant, and include other objects. We build temporary racks and devices and move them around while in the planning stages, and this would make cleanup much easier.
adam closed this issue 2025-12-29 16:26:47 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 2, 2017):

I'm not sure I like this idea. Enabling recursive deletion can be extremely dangerous. I understand where you're coming from, but it opens the door for a user to mistakenly wipe out an entire site. We could mitigate the risk by explicitly listing everything to be deleted, but it's very plausible that a user will still mistakenly delete many objects in bulk. NetBox has no revision system to allow for restoration; the only avenue for recovery is restoring a database backup.

@jeremystretch commented on GitHub (May 2, 2017): I'm not sure I like this idea. Enabling recursive deletion can be _extremely_ dangerous. I understand where you're coming from, but it opens the door for a user to mistakenly wipe out an entire site. We could mitigate the risk by explicitly listing everything to be deleted, but it's very plausible that a user will still mistakenly delete many objects in bulk. NetBox has no revision system to allow for restoration; the only avenue for recovery is restoring a database backup.
Author
Owner

@zevlag commented on GitHub (May 2, 2017):

I understand that risk, and it definitely is a concern, I'd be interested to hear from others if they think this would be useful.

@zevlag commented on GitHub (May 2, 2017): I understand that risk, and it definitely is a concern, I'd be interested to hear from others if they think this would be useful.
Author
Owner

@jeremystretch commented on GitHub (May 9, 2017):

Closing this out due to lack of responses and because I think it's a bad idea. I get where you're coming from, but I prefer the minor inconvenience of having to delete dependent objects (in bulk) over the increased risk of accidentally destroying data.

@jeremystretch commented on GitHub (May 9, 2017): Closing this out due to lack of responses and because I think it's a bad idea. I get where you're coming from, but I prefer the minor inconvenience of having to delete dependent objects (in bulk) over the increased risk of accidentally destroying data.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#895