File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,14 @@ Keys for interfaces.yml or interfaces_<model>.yml:
404404 * aggregate_id: Optional. Identifier for configuring LACP etc. Integer value.
405405 Special value -1 means configure MLAG and use ID based on indexnum.
406406 * tags: Optional list of strings, custom user defined tags to apply.
407+ * vrf: Optional VRF instance, must be specified if IP adress is specified
408+ * ipv4_address: Optional IPv4 address for the interface
409+ * ipv6_address: Optional IPv6 address for the interface
410+ * mtu: Optional integer specifying MTU size
411+ * acl_ipv4_in: Access control list to apply for ingress IPv4 traffic to interface. Optional.
412+ * acl_ipv4_out: Access control list to apply for egress IPv4 traffic from interface. Optional.
413+ * acl_ipv6_in: Access control list to apply for ingress IPv6 traffic to interface. Optional.
414+ * acl_ipv6_out: Access control list to apply for egress IPv6 traffic from interface. Optional.
407415 * cli_append_str: Optional. Custom configuration to append to this interface.
408416
409417The "downlink" ifclass is used on DIST devices to specify that this interface
Original file line number Diff line number Diff line change @@ -139,8 +139,24 @@ class f_interface(BaseModel):
139139 tagged_vlan_list : Optional [List [int ]] = None
140140 aggregate_id : Optional [int ] = None
141141 tags : Optional [List [str ]] = None
142+ vrf : Optional [str ] = vlan_name_schema
143+ ipv4_address : Optional [str ] = None
144+ ipv6_address : Optional [str ] = ipv6_if_schema
145+ mtu : Optional [int ] = mtu_schema
146+ acl_ipv4_in : Optional [str ] = None
147+ acl_ipv4_out : Optional [str ] = None
148+ acl_ipv6_in : Optional [str ] = None
149+ acl_ipv6_out : Optional [str ] = None
142150 cli_append_str : str = ""
143151
152+ @validator ("ipv4_address" )
153+ def vrf_required_if_ipv4_address_set (cls , v , values , ** kwargs ):
154+ if v :
155+ validate_ipv4_if (v )
156+ if "vrf" not in values or not values ["vrf" ]:
157+ raise ValueError ("VRF is required when specifying ipv4_gw" )
158+ return v
159+
144160 @validator ("tagged_vlan_list" , each_item = True )
145161 def check_valid_vlan_ids (cls , v ):
146162 assert 0 < v < 4096
You can’t perform that action at this time.
0 commit comments