-
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
Add custom validation functionality for the models' delete method #10244
Comments
Interesting idea. We could probably implement this by hooking into the |
I would differentiate the two by their configuration parameter names based on their respective roles. |
Maybe we call them something like "protection rules" instead, and just use the same configuration format that we do for validators. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
I think this would be a good addition. Open to any contributors, otherwise I'll pick it up when I get time. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
I'm going to tag this as |
Love this! This would be very handy for us so only devices in a certain status could be deleted (we've introduced |
Hi! I'd be interested to volunteer on implementing this, it seems like a small, self-contained feature and straight-forward enough. But it's set as "needs milestone", I'm not sure what that means in the context of this project? |
@pv2b I've just tagged this for the upcoming v3.7 release if you'd like to work on it. (Please base your work on the |
I'll be happy to work on this, but I'd like to see some progress on my other PR's on this project for work on accepted bug fixes before I do. I don't want to add too much to the projects backlog of pull requests. |
@pv2b I've already completed work on this, thanks though. |
NetBox version
v3.3.1
Feature type
New functionality
Proposed functionality
NetBox's extensible custom validation is a very nice feature which allows users to inject their own business-specific logic into the models' create and update methods. I'm proposing to add the same functionality to the delete method.
Use case
Users would be able to add their own logic to ensure instantiated models are not unintentionally deleted or to better control cascading effects of a delete. One example use case would be to ensure no IP addresses are assigned to a device's or virtual machine's interfaces before deleting either the device/VM or one of its interfaces. In our deployment of NetBox we track a good bit of metadata associated with IP addresses (such as NATs, ICMP polling status, and monitoring flags) and typically assign already created IPs to interfaces rather than creating them when assigning them.
Database changes
None
External dependencies
None
The text was updated successfully, but these errors were encountered: