Constraints Tab
The Constraints system allows Admin users to configure custom field validation and limitations into IPAM and Resource fields. Many constraint types are available, such as mathematical comparison operators, length, enumeration, pre-set lists, RegEx, IPv4/IPv6, Phone, email, hostname, FQDN, Mac Address, and URL.
The Constraints Tab has one sub-tab - Configuration - where new constraints may be created and managed.
Table of Contents |
---|
Constraints Tab - Overview
The Constraints Tab, available to Admin users, allows for custom field validation and field restrictions to be created for Resource and IPAM fields. Constraints are applied to Resource fields from the Edit Section page and to IPAM fields from the Admin Edit IPAM Columns page. The applied constraint may be anything from a numerical comparison operation, a check against a pre-determined text string, ensuring selections from a pre-set list, or forcing entries into a specific format, such as IPv4/IPv6, phone number, or RegEx.
...
Depending on the type of constraint applied, the constraint may be a simple single-value comparison needing only one constraint to be created, such as "Equals to" or "Length Max". Some other constraint types, however, may have two or more levels deep of constraint types and value checks. One example of this is "Enumeration", which requires the user to first set up an "Enumeration" constraint, and then a second level list of sub-constraint types or a list of values.
Available Constraint Types
The following constraint types are currently available:
Type | Description |
---|---|
Enumeration | Create a list of child enum items. |
Section Entry | Creates an enumeration based on all entries that belong to a given section. |
Resource Type | Creates an enumeration based on a Resource type. |
Resource Entry | Creates an enumeration based on all resource entries. |
IPAM Region | Creates an enumeration based on all IPAM Regions. |
IPAM Tags | Creates an enumeration based on all IPAM Tags. |
Equals to | Checks to ensure a value is exactly equal to a provided value, e.g. (X == Y) is true |
Not Equal to | Checks to ensure a value is not equal to a provided value, e.g. (X != Y) is true |
Greater Than | Checks if the input value (left operand) is greater than a given value (right operand). e.g. (X ﹥ Y) is true |
Less Than | Checks if the input value (left operand) is less than a given value (right operand). e.g. (X ﹤ Y) is true |
Greater Than or Equal to | Checks if the input value (left operand) is greater than or equals to a given value (right operand). e.g. (X ﹥= Y) is true |
Less Than or Equal to | Checks if the input value (left operand) is less than or equals to a given value (right operand). e.g. (X ﹤= Y) is true |
One of | Create a list of child constraint items. It will be true if one of child constraints is true. Its children must be previously configured. |
All of | Create a list of child constraint items. It will be true if all of the child constraints are true. Its children must be previously configured. |
Length Max | Checks to ensure a string has, at most, the specified number of characters |
Length Min | Checks to ensure a string has, at minimum, the specified number of characters |
Regular Expression | Compares the input format to a provided Regular Expression |
IPv4 | Sets the required format for the input to an IPv4 address |
IPv6 | Sets the required format for the input to an IPv6 address |
Sets the required format for the input to an email address (uses an "@" symbol) | |
Hostname | Sets the required format for the input to a hostname. Hostnames may not have underscore or dash characters. |
FQDN | Sets the required format for the input to a FQDN |
MAC Address | Sets the required format for the input to a MAC address |
URL | Sets the required format for the input to a url |
Phone Number | Sets the required format for the input to a phone number |
Constraints List
...
The Constraints List displays all registered constraints and is where you can view, edit, test, and delete existing constraints.
...
Click the link for a resource field to see which sections have that field enabled. Click a section name to go to the Section Edit page. Click the link for a IPAM column to go to the Edit IPAM Columns page. Constraints can be applied or removed from both these locations.
Working with Constraints
Add a Constraint
To add a new Constraint, click "Add Constraint" at the top right of the page.
...
When done, click "Add Constraint" to save.
Test Constraint
To test a Constraint, right click to open the Options action menu and select "Test".
...
Valid result, for "Length Min 3":
Edit Constraint
To edit a Constraint, right click to open the Options action menu and select "Edit". The constraint details will open, matching the "Add Constraint" form.
...
Adjust values or settings as desired, and then click "Update Constraint".
Delete Constraint
To delete a Constraint, right click to open the Options action menu and select "Delete".
...
To do so, select the checkboxes for the desired constraints, then under the "Actions" menu at the top of the list, select "Delete All".
Working with Constraints in IPAM
Apply a Constraint
To apply a constraint to an IPAM field, go to IPAM Admin → Edit IPAM Columns.
...
On the other hand, a valid input will return to displaying the "valid" success checkmark:
Working with Constraints in Resources
Apply a Constraint
To apply a constraint to an Resource field, go to Edit Section, "Manage Fields" tab. Open the edit modal for an assigned field. Select a constraint from the dropdown and click "Save".
...
Constrained Fields in Resources
Resource Field constraints appear in the following areas of the Resource system:
...
A constrained field is available to edit from the Resource List Edit Fields modal
...
and the Resource's Fields Gadget.
When a field is viewed that has a constraint applied, a "check" icon will display next to the field input for simple input constraint checks.
...
A valid constraint input:
Constraint Permissions
Admins can limit which users are bound by certain constraints by clicking "Settings" at upper right.
...
Note |
---|
Enabling user group permissions applies to all constraints, including those already existing. If no group is assigned to a constraint, it will not be visible in IPAM Manage to any users. |
Example: Adding an Enumeration Constraint Containing Children
This example shows how to add a two-level Enumeration constraint, which are set up having a "parent" constraint at the top level list, and "child" items or constraints on a sub-level.
...
A display dropdown box will appear. Click inside of it to confirm your child items show as selectable options.
Using the Enumeration
To see the constraint in action in IPAM or Resources, navigate to a block or field and open Edit. Select the field to which you applied the enumeration to view/select constraint items from the dropdown
Additional Information
For additional information on working with IPAM Manage or IPAM Blocks, see
...