Skip to content

Add custom validation functionality for the models' delete method #10244

@atownson

Description

@atownson

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

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions