Revision, images have been removed as I don't understand how to embed them correctly.

This commit is contained in:
LHBL2003 2024-11-17 11:55:08 +01:00
parent 771ac8acd9
commit e131436efd
3 changed files with 2 additions and 28 deletions

View File

@ -94,24 +94,8 @@ The following colors are supported:
!!! tip "Dynamic Configuration Parameter"
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:
```python
PROTECTION_RULES = {
"dcim.site": [
{
"status": {
"eq": "decommissioning"
}
},
"my_plugin.validators.Validator1",
]
}
```
### Configuration via Web UI
Example prevents the deletion of a device entry:
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. The configuration can be carried out in the menu under “System/Configuration History/Custom validators”.
In the example, a device can only be deleted when it is set to the “decommissioning” status. Paths such as “dcim.device” can be found in the top right-hand corner when you open the page of a device. For a rack it would therefore be “dcim.rack”.
```python
{
@ -124,13 +108,3 @@ Example prevents the deletion of a device entry:
]
}
```
[![NetBox UI](./media/screenshots/Configuration-History-Protection-rules-Example.png)](./media/screenshots/Configuration-History-Protection-rules-Example.png)
If you navigate to a device, rack or site, you will find the path in the top right-hand corner:
[![NetBox UI](./media/screenshots/Device-Type-Path-Example.png)](./media/screenshots/Device-Type-Path-Example.png)
Examples:
- dcim.device
- dcim.site
- dcim.rack

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB