You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev/validation.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,16 +87,21 @@ Validator recognizes standard Python data types (**str**, **int**, **bool**, **l
87
87
88
88
| Data type. | Meaning |
89
89
|----------------|---------|
90
-
|**asn**| AS number (an integer between 1 and 65535) |
90
+
|**addr_pool**|[Address pool](address-pools)|
91
+
|**asn**| AS number (2-octer or 4-octet) |
92
+
|**asn2**| 2-octet ASN |
93
+
|**bool_false**| The only valid value is *false*|
91
94
|**device**| Valid device (platform) identifier |
92
95
|**id**| Identifier (containing A-Z, a-z, 0-9 and underscore) |
93
96
|**ipv4**| An IPv4 address, prefix, integer (offset in a subnet), or bool (unnumbered) |
94
97
|**ipv6**| An IPv6 address, prefix, integer (offset in a subnet), or bool (LLA only) |
95
98
|**mac**| MAC address in any format recognized by the `netaddr` library |
99
+
|**named_pfx**|[named prefix](named-prefixes)|
96
100
|**net**| IS-IS NET/NSAP |
97
101
|**node_id**| Valid node name |
98
102
|**prefix_str**| An IPv4 or IPv6 prefix |
99
103
|**rd**| Route distinguisher (ASN:ID or IP:ID) |
104
+
|**r_proto**| Routing protocol identifier |
100
105
101
106
The data type can be specified as a string (without additional parameters) or a dictionary with a **type** attribute (data type as a string) and other type-specific validation parameters.
102
107
@@ -115,9 +120,11 @@ All attributes defined with a dictionary (**mode** in the above example, but not
115
120
116
121
***true_value** -- value to use when the parameter is set to *True*
117
122
***_requires** -- a list of modules that must be enabled in global- or node context to allow the use of this attribute. See `vrfs` in `modules/vrf.yml` and `vlans` in `modules/vlan.yml` for more details.
118
-
***_required** (bool) -- the attribute must be present if the parent in the parent dictionary
123
+
***_required** (bool) -- the attribute must be present in the parent dictionary[^CRQ]
119
124
***_alt_types** -- [alternate data types](validation-alt-types)
120
125
126
+
[^CRQ]: This does not make the parent dictionary mandatory, but if it's present, it must have the required attribute. Use a chain of `_required` attributes if you want to enforce the presence of an attribute deep in the data structure.
127
+
121
128
See [](validation-definition-examples) for more details.
0 commit comments