diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge1.cfg index 7c51003d166..f6d0da727d6 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/cv-pathfinder-edge1.cfg @@ -150,6 +150,10 @@ router internet-exit router path-selection tcp mss ceiling ipv4 ingress ! + interface Ethernet2 + metric bandwidth transmit 412 Mbps + metric bandwidth receive 34 Mbps + ! path-group AWS id 105 ipsec profile CP-PROFILE ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge1.yml index 2720f73d95e..2706695aee2 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/cv-pathfinder-edge1.yml @@ -1201,6 +1201,11 @@ router_path_selection: priority: 2 tcp_mss_ceiling: ipv4_segment_size: auto + interfaces: + - name: Ethernet2 + metric_bandwidth: + receive: 34 + transmit: 412 router_service_insertion: enabled: true connections: diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml index d5064b2e910..07011632c78 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/CV_PATHFINDER_TESTS.yml @@ -182,6 +182,8 @@ wan_router: dhcp_accept_default_route: true ip_address: dhcp connected_to_pathfinder: false + receive_bandwidth: 34 + transmit_bandwidth: 412 - name: Ethernet3 wan_carrier: ATT wan_circuit_id: 404 diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-l3-interfaces-configuration.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-l3-interfaces-configuration.md index c3f39baf1a3..1c438c0f57a 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-l3-interfaces-configuration.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/node-type-l3-interfaces-configuration.md @@ -20,6 +20,8 @@ | [        dhcp_accept_default_route](## ".defaults.l3_interfaces.[].dhcp_accept_default_route") | Boolean | | `True` | | Accept a default route from DHCP if `ip_address` is set to `dhcp`. | | [        enabled](## ".defaults.l3_interfaces.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. | | [        speed](## ".defaults.l3_interfaces.[].speed") | String | | | | Speed should be set in the format `` or `forced ` or `auto `. | + | [        receive_bandwidth](## ".defaults.l3_interfaces.[].receive_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed receive bandwidth (download) in Mbps for this interface. | + | [        transmit_bandwidth](## ".defaults.l3_interfaces.[].transmit_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed transmit bandwidth (upload) in Mbps for this interface. | | [        peer](## ".defaults.l3_interfaces.[].peer") | String | | | | The peer device name. Used for description and documentation. | | [        peer_interface](## ".defaults.l3_interfaces.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation. | | [        peer_ip](## ".defaults.l3_interfaces.[].peer_ip") | String | | | | The peer device IPv4 address (no mask). Used as default route gateway if `set_default_route` is true and `ip` is an IP address. | @@ -59,6 +61,8 @@ | [              dhcp_accept_default_route](## ".node_groups.[].nodes.[].l3_interfaces.[].dhcp_accept_default_route") | Boolean | | `True` | | Accept a default route from DHCP if `ip_address` is set to `dhcp`. | | [              enabled](## ".node_groups.[].nodes.[].l3_interfaces.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. | | [              speed](## ".node_groups.[].nodes.[].l3_interfaces.[].speed") | String | | | | Speed should be set in the format `` or `forced ` or `auto `. | + | [              receive_bandwidth](## ".node_groups.[].nodes.[].l3_interfaces.[].receive_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed receive bandwidth (download) in Mbps for this interface. | + | [              transmit_bandwidth](## ".node_groups.[].nodes.[].l3_interfaces.[].transmit_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed transmit bandwidth (upload) in Mbps for this interface. | | [              peer](## ".node_groups.[].nodes.[].l3_interfaces.[].peer") | String | | | | The peer device name. Used for description and documentation. | | [              peer_interface](## ".node_groups.[].nodes.[].l3_interfaces.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation. | | [              peer_ip](## ".node_groups.[].nodes.[].l3_interfaces.[].peer_ip") | String | | | | The peer device IPv4 address (no mask). Used as default route gateway if `set_default_route` is true and `ip` is an IP address. | @@ -94,6 +98,8 @@ | [          dhcp_accept_default_route](## ".node_groups.[].l3_interfaces.[].dhcp_accept_default_route") | Boolean | | `True` | | Accept a default route from DHCP if `ip_address` is set to `dhcp`. | | [          enabled](## ".node_groups.[].l3_interfaces.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. | | [          speed](## ".node_groups.[].l3_interfaces.[].speed") | String | | | | Speed should be set in the format `` or `forced ` or `auto `. | + | [          receive_bandwidth](## ".node_groups.[].l3_interfaces.[].receive_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed receive bandwidth (download) in Mbps for this interface. | + | [          transmit_bandwidth](## ".node_groups.[].l3_interfaces.[].transmit_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed transmit bandwidth (upload) in Mbps for this interface. | | [          peer](## ".node_groups.[].l3_interfaces.[].peer") | String | | | | The peer device name. Used for description and documentation. | | [          peer_interface](## ".node_groups.[].l3_interfaces.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation. | | [          peer_ip](## ".node_groups.[].l3_interfaces.[].peer_ip") | String | | | | The peer device IPv4 address (no mask). Used as default route gateway if `set_default_route` is true and `ip` is an IP address. | @@ -131,6 +137,8 @@ | [          dhcp_accept_default_route](## ".nodes.[].l3_interfaces.[].dhcp_accept_default_route") | Boolean | | `True` | | Accept a default route from DHCP if `ip_address` is set to `dhcp`. | | [          enabled](## ".nodes.[].l3_interfaces.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. | | [          speed](## ".nodes.[].l3_interfaces.[].speed") | String | | | | Speed should be set in the format `` or `forced ` or `auto `. | + | [          receive_bandwidth](## ".nodes.[].l3_interfaces.[].receive_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed receive bandwidth (download) in Mbps for this interface. | + | [          transmit_bandwidth](## ".nodes.[].l3_interfaces.[].transmit_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed transmit bandwidth (upload) in Mbps for this interface. | | [          peer](## ".nodes.[].l3_interfaces.[].peer") | String | | | | The peer device name. Used for description and documentation. | | [          peer_interface](## ".nodes.[].l3_interfaces.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation. | | [          peer_ip](## ".nodes.[].l3_interfaces.[].peer_ip") | String | | | | The peer device IPv4 address (no mask). Used as default route gateway if `set_default_route` is true and `ip` is an IP address. | @@ -166,6 +174,8 @@ | [    dhcp_accept_default_route](## "l3_interface_profiles.[].dhcp_accept_default_route") | Boolean | | `True` | | Accept a default route from DHCP if `ip_address` is set to `dhcp`. | | [    enabled](## "l3_interface_profiles.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. | | [    speed](## "l3_interface_profiles.[].speed") | String | | | | Speed should be set in the format `` or `forced ` or `auto `. | + | [    receive_bandwidth](## "l3_interface_profiles.[].receive_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed receive bandwidth (download) in Mbps for this interface. | + | [    transmit_bandwidth](## "l3_interface_profiles.[].transmit_bandwidth") | Integer | | | Min: 1
Max: 4294967295 | Maximum allowed transmit bandwidth (upload) in Mbps for this interface. | | [    peer](## "l3_interface_profiles.[].peer") | String | | | | The peer device name. Used for description and documentation. | | [    peer_interface](## "l3_interface_profiles.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation. | | [    peer_ip](## "l3_interface_profiles.[].peer_ip") | String | | | | The peer device IPv4 address (no mask). Used as default route gateway if `set_default_route` is true and `ip` is an IP address. | @@ -246,6 +256,12 @@ # Speed should be set in the format `` or `forced ` or `auto `. speed: + # Maximum allowed receive bandwidth (download) in Mbps for this interface. + receive_bandwidth: + + # Maximum allowed transmit bandwidth (upload) in Mbps for this interface. + transmit_bandwidth: + # The peer device name. Used for description and documentation. peer: @@ -386,6 +402,12 @@ # Speed should be set in the format `` or `forced ` or `auto `. speed: + # Maximum allowed receive bandwidth (download) in Mbps for this interface. + receive_bandwidth: + + # Maximum allowed transmit bandwidth (upload) in Mbps for this interface. + transmit_bandwidth: + # The peer device name. Used for description and documentation. peer: @@ -513,6 +535,12 @@ # Speed should be set in the format `` or `forced ` or `auto `. speed: + # Maximum allowed receive bandwidth (download) in Mbps for this interface. + receive_bandwidth: + + # Maximum allowed transmit bandwidth (upload) in Mbps for this interface. + transmit_bandwidth: + # The peer device name. Used for description and documentation. peer: @@ -646,6 +674,12 @@ # Speed should be set in the format `` or `forced ` or `auto `. speed: + # Maximum allowed receive bandwidth (download) in Mbps for this interface. + receive_bandwidth: + + # Maximum allowed transmit bandwidth (upload) in Mbps for this interface. + transmit_bandwidth: + # The peer device name. Used for description and documentation. peer: @@ -774,6 +808,12 @@ # Speed should be set in the format `` or `forced ` or `auto `. speed: + # Maximum allowed receive bandwidth (download) in Mbps for this interface. + receive_bandwidth: + + # Maximum allowed transmit bandwidth (upload) in Mbps for this interface. + transmit_bandwidth: + # The peer device name. Used for description and documentation. peer: diff --git a/python-avd/pyavd/_eos_designs/schema/__init__.py b/python-avd/pyavd/_eos_designs/schema/__init__.py index 8b4205ad460..6324d2c400f 100644 --- a/python-avd/pyavd/_eos_designs/schema/__init__.py +++ b/python-avd/pyavd/_eos_designs/schema/__init__.py @@ -6070,6 +6070,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -6153,6 +6155,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -6247,6 +6253,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -6312,6 +6320,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -19524,6 +19534,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -19604,6 +19616,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -19698,6 +19714,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -19761,6 +19779,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -23424,6 +23444,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -23504,6 +23526,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -23598,6 +23624,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -23661,6 +23689,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -27282,6 +27312,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -27362,6 +27394,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -27456,6 +27492,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -27519,6 +27557,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -31198,6 +31238,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -31278,6 +31320,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -31372,6 +31418,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -31435,6 +31483,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -41489,6 +41539,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -41569,6 +41621,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -41663,6 +41719,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -41726,6 +41784,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -45389,6 +45449,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -45469,6 +45531,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -45563,6 +45629,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -45626,6 +45694,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -49247,6 +49317,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -49327,6 +49399,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -49421,6 +49497,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -49484,6 +49562,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: @@ -53163,6 +53243,8 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): "dhcp_accept_default_route": {"type": bool, "default": True}, "enabled": {"type": bool, "default": True}, "speed": {"type": str}, + "receive_bandwidth": {"type": int}, + "transmit_bandwidth": {"type": int}, "peer": {"type": str}, "peer_interface": {"type": str}, "peer_ip": {"type": str}, @@ -53243,6 +53325,10 @@ class StructuredConfig(EosCliConfigGen.EthernetInterfacesItem): Speed should be set in the format `` or `forced ` or `auto `. """ + receive_bandwidth: int | None + """Maximum allowed receive bandwidth (download) in Mbps for this interface.""" + transmit_bandwidth: int | None + """Maximum allowed transmit bandwidth (upload) in Mbps for this interface.""" peer: str | None """The peer device name. Used for description and documentation.""" peer_interface: str | None @@ -53337,6 +53423,8 @@ def __init__( dhcp_accept_default_route: bool | UndefinedType = Undefined, enabled: bool | UndefinedType = Undefined, speed: str | None | UndefinedType = Undefined, + receive_bandwidth: int | None | UndefinedType = Undefined, + transmit_bandwidth: int | None | UndefinedType = Undefined, peer: str | None | UndefinedType = Undefined, peer_interface: str | None | UndefinedType = Undefined, peer_ip: str | None | UndefinedType = Undefined, @@ -53400,6 +53488,8 @@ def __init__( speed: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: Maximum allowed receive bandwidth (download) in Mbps for this interface. + transmit_bandwidth: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. peer: The peer device name. Used for description and documentation. peer_interface: The peer device interface. Used for description and documentation. peer_ip: diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index c9a0955b2d8..3fab6dd33e1 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -9627,6 +9627,22 @@ $defs: type: str description: Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: + type: int + description: Maximum allowed receive bandwidth (download) in Mbps for this + interface. + min: 1 + max: 4294967295 + convert_types: + - str + transmit_bandwidth: + type: int + description: Maximum allowed transmit bandwidth (upload) in Mbps for this + interface. + min: 1 + max: 4294967295 + convert_types: + - str peer: type: str description: The peer device name. Used for description and documentation. diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_l3_interfaces.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_l3_interfaces.schema.yml index 21caa4463fd..98aa493b066 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_l3_interfaces.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_node_type_l3_interfaces.schema.yml @@ -65,6 +65,20 @@ $defs: type: str description: |- Speed should be set in the format `` or `forced ` or `auto `. + receive_bandwidth: + type: int + description: Maximum allowed receive bandwidth (download) in Mbps for this interface. + min: 1 + max: 4294967295 + convert_types: + - str + transmit_bandwidth: + type: int + description: Maximum allowed transmit bandwidth (upload) in Mbps for this interface. + min: 1 + max: 4294967295 + convert_types: + - str peer: type: str description: |- diff --git a/python-avd/pyavd/_eos_designs/structured_config/overlay/router_path_selection.py b/python-avd/pyavd/_eos_designs/structured_config/overlay/router_path_selection.py index 16ca690aece..d95b2b198b2 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/overlay/router_path_selection.py +++ b/python-avd/pyavd/_eos_designs/structured_config/overlay/router_path_selection.py @@ -31,6 +31,9 @@ def router_path_selection(self: AvdStructuredConfigOverlayProtocol) -> dict | No "path_groups": self._get_path_groups(), } + metric_interfaces = self._get_interface_bandwidths(router_path_selection["path_groups"]) + router_path_selection["interfaces"] = metric_interfaces + if self.shared_utils.is_wan_server: router_path_selection["peer_dynamic_source"] = "stun" @@ -128,6 +131,24 @@ def _generate_ha_path_group(self: AvdStructuredConfigOverlayProtocol) -> dict: return ha_path_group + def _get_interface_bandwidths(self: AvdStructuredConfigOverlayProtocol, path_groups: dict) -> dict: + """Generate the bandwidths for the interfaces configured in path groups.""" + wan_interfaces = self.shared_utils.wan_interfaces + metric_interfaces = [] + for path_group in path_groups: + interfaces = path_group.get("local_interfaces", []) + for interface in interfaces: + name = interface["name"] + if (l3_intf := wan_interfaces.get(name)): + bandwidths = {} + if l3_intf.receive_bandwidth is not None: + bandwidths["receive"] = l3_intf.receive_bandwidth + if l3_intf.transmit_bandwidth is not None: + bandwidths["transmit"] = l3_intf.transmit_bandwidth + if bandwidths: + metric_interfaces.append({"name": name, "metric_bandwidth": bandwidths}) + return metric_interfaces + def _wan_ha_interfaces(self: AvdStructuredConfigOverlayProtocol) -> list: """Return list of interfaces for HA.""" return [uplink for uplink in self.shared_utils.get_switch_fact("uplinks") if get(uplink, "vrf") is None]