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

Allow ifclass port_template_esx for exmaple [settings] #193

Merged
merged 3 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/reporef/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ Keys for interfaces.yml or interfaces_<model>.yml:
* interfaces: List of dicctionaries with keys:

* name: Interface name, like "Ethernet1"
* ifclass: Interface class, one of: downlink, fabric, custom
* ifclass: Interface class, one of: downlink, fabric, custom, port_template_*
* config: Optional. Raw CLI config used in case "custom" ifclass was selected

The "downlink" ifclass is used on DIST devices to specify that this interface
Expand All @@ -295,6 +295,10 @@ the switch (vxlan) fabric. Linknet data will only be configured on interfaces
specified as "fabric". If no linknet data is available in the database then
the fabric interface will be configured for ZTP of DIST/CORE devices by
providing DHCP (relay) access.
"port_template_*" is used to specify a user defined port template. This can then
be used to apply some site-specific configuration via Jinja templates. For
example specify "port_template_hypervisor" and build a corresponding Jinja
template by matching on that ifclass.

base_system.yml:

Expand Down
2 changes: 1 addition & 1 deletion src/cnaas_nms/db/settings_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
IFNAME_REGEX = r'([a-zA-Z0-9\/\.:-])+'
ifname_schema = Field(None, regex=f"^{IFNAME_REGEX}$",
description="Interface name")
IFCLASS_REGEX = r'(custom|downlink|fabric)'
IFCLASS_REGEX = r'(custom|downlink|fabric|port_template_[a-zA-Z0-9_]+)'
ifclass_schema = Field(None, regex=f"^{IFCLASS_REGEX}$",
description="Interface class: custom, downlink or uplink")
tcpudp_port_schema = Field(None, ge=0, lt=65536, description="TCP or UDP port number, 0-65535")
Expand Down