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

Update data-validation.md #16183

Closed
wants to merge 12 commits into from
32 changes: 32 additions & 0 deletions docs/configuration/data-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ The following colors are supported:

This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below:

**Example prevents the deletion of a site entry:**
arthanson marked this conversation as resolved.
Show resolved Hide resolved
```python
PROTECTION_RULES = {
"dcim.site": [
Expand All @@ -108,3 +109,34 @@ PROTECTION_RULES = {
]
}
```

### Configuration via Web UI

![image](https://github.com/netbox-community/netbox/assets/46369917/6fb69ab8-1f13-4b86-b84c-ce697af8f679)
arthanson marked this conversation as resolved.
Show resolved Hide resolved

**Path:**
- WebUI (v3.x.x) --> Admin --> Configuration Config Revisions --> Add (or Edit last Config)
- WebUI (v4.0.0) --> Admin --> Configuration History --> Add (or Edit last Config)
arthanson marked this conversation as resolved.
Show resolved Hide resolved

**Example prevents the deletion of a device entry:**
arthanson marked this conversation as resolved.
Show resolved Hide resolved
```python
{
"dcim.device": [
{
"status": {
"eq": "decommissioning"
}
}
]
}
```

If you navigate to a device, rack or site, you will find the path in the top right-hand corner.

![image](https://github.com/netbox-community/netbox/assets/46369917/3f1c8f12-0714-4590-99d7-41ef5da7c1c3)

Examples:
- dcim.device
- dcim.site
- dcim.rack
```
Loading