diff --git a/docs/reporef/index.rst b/docs/reporef/index.rst index 33dd68e0..7b228f69 100644 --- a/docs/reporef/index.rst +++ b/docs/reporef/index.rst @@ -285,7 +285,7 @@ Keys for interfaces.yml or interfaces_.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 @@ -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: diff --git a/src/cnaas_nms/db/settings_fields.py b/src/cnaas_nms/db/settings_fields.py index c511c86c..5c8096d2 100644 --- a/src/cnaas_nms/db/settings_fields.py +++ b/src/cnaas_nms/db/settings_fields.py @@ -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")