Skip to content

Commit

Permalink
Refactor: Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Oct 10, 2023
1 parent ee78e79 commit a542649
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface Management1

| Interface | IP address | Shutdown | Flow tracker(s) | TCP MSS Ceiling |
| --------- | ---------- | -------- | --------------- | --------------- |
| Dps1 | 192.168.42.42/24 | True | * Hardware: FT-HW<br>* Sampled: FT-S | * IPv4: 666<br>* IPv6: 666<br>* Direction: ingress |
| Dps1 | 192.168.42.42/24 | True | Hardware: FT-HW<br>Sampled: FT-S | IPv4: 666<br>IPv6: 666<br>Direction: ingress |

#### DPS Interfaces Device Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
| Variable | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>dps_interfaces</samp>](## "dps_interfaces") | List, items: Dictionary | | | Min Length: 1<br>Max Length: 1 | |
| [<samp>&nbsp;&nbsp;- name</samp>](## "dps_interfaces.[].name") | String | Required, Unique | | Valid Values:<br>- Dps1 | Only Dps1 is configurabled. |
| [<samp>&nbsp;&nbsp;- name</samp>](## "dps_interfaces.[].name") | String | Required, Unique | | Valid Values:<br>- Dps1 | "Dps1" is currently the only supported interface. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;description</samp>](## "dps_interfaces.[].description") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;shutdown</samp>](## "dps_interfaces.[].shutdown") | Boolean | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;ip_address</samp>](## "dps_interfaces.[].ip_address") | String | | | | IPv4 address/mask |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;ip_address</samp>](## "dps_interfaces.[].ip_address") | String | | | | IPv4 address/mask. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;flow_tracker</samp>](## "dps_interfaces.[].flow_tracker") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampled</samp>](## "dps_interfaces.[].flow_tracker.sampled") | String | | | | Sampled flow tracker name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware</samp>](## "dps_interfaces.[].flow_tracker.hardware") | String | | | | Hardware flow tracker name |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sampled</samp>](## "dps_interfaces.[].flow_tracker.sampled") | String | | | | Sampled flow tracker name. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware</samp>](## "dps_interfaces.[].flow_tracker.hardware") | String | | | | Hardware flow tracker name, |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;tcp_mss_ceiling</samp>](## "dps_interfaces.[].tcp_mss_ceiling") | Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipv4</samp>](## "dps_interfaces.[].tcp_mss_ceiling.ipv4") | Integer | | | Min: 64<br>Max: 65495 | Segment Size for IPv4 |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipv6</samp>](## "dps_interfaces.[].tcp_mss_ceiling.ipv6") | Integer | | | Min: 64<br>Max: 65475 | Segment Size for IPv6 |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction</samp>](## "dps_interfaces.[].tcp_mss_ceiling.direction") | String | | | Valid Values:<br>- ingress<br>- egress | Optional direction ('ingress', 'egress') for tcp mss ceiling<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipv4</samp>](## "dps_interfaces.[].tcp_mss_ceiling.ipv4") | Integer | | | Min: 64<br>Max: 65495 | Segment Size for IPv4. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipv6</samp>](## "dps_interfaces.[].tcp_mss_ceiling.ipv6") | Integer | | | Min: 64<br>Max: 65475 | Segment Size for IPv6. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direction</samp>](## "dps_interfaces.[].tcp_mss_ceiling.direction") | String | | | Valid Values:<br>- ingress<br>- egress | Optional direction ('ingress', 'egress') for tcp mss ceiling. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;eos_cli</samp>](## "dps_interfaces.[].eos_cli") | String | | | | Multiline String with EOS CLI rendered directly on the Dps interface in the final EOS configuration. |

=== "YAML"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@
"properties": {
"name": {
"type": "string",
"description": "Only Dps1 is configurabled.",
"description": "\"Dps1\" is currently the only supported interface.",
"enum": [
"Dps1"
],
Expand All @@ -1553,20 +1553,20 @@
},
"ip_address": {
"type": "string",
"description": "IPv4 address/mask",
"description": "IPv4 address/mask.",
"title": "IP Address"
},
"flow_tracker": {
"type": "object",
"properties": {
"sampled": {
"type": "string",
"description": "Sampled flow tracker name",
"description": "Sampled flow tracker name.",
"title": "Sampled"
},
"hardware": {
"type": "string",
"description": "Hardware flow tracker name",
"description": "Hardware flow tracker name,",
"title": "Hardware"
}
},
Expand All @@ -1581,14 +1581,14 @@
"properties": {
"ipv4": {
"type": "integer",
"description": "Segment Size for IPv4",
"description": "Segment Size for IPv4.",
"minimum": 64,
"maximum": 65495,
"title": "IPv4"
},
"ipv6": {
"type": "integer",
"description": "Segment Size for IPv6",
"description": "Segment Size for IPv6.",
"minimum": 64,
"maximum": 65475,
"title": "IPv6"
Expand All @@ -1599,7 +1599,7 @@
"ingress",
"egress"
],
"description": "Optional direction ('ingress', 'egress') for tcp mss ceiling\n",
"description": "Optional direction ('ingress', 'egress') for tcp mss ceiling.",
"title": "Direction"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ keys:
keys:
name:
type: str
description: Only Dps1 is configurabled.
description: '"Dps1" is currently the only supported interface.'
valid_values:
- Dps1
description:
Expand All @@ -1076,29 +1076,29 @@ keys:
type: bool
ip_address:
type: str
description: IPv4 address/mask
description: IPv4 address/mask.
flow_tracker:
type: dict
keys:
sampled:
type: str
description: Sampled flow tracker name
description: Sampled flow tracker name.
hardware:
type: str
description: Hardware flow tracker name
description: Hardware flow tracker name,
tcp_mss_ceiling:
type: dict
keys:
ipv4:
type: int
description: Segment Size for IPv4
description: Segment Size for IPv4.
min: 64
max: 65495
convert_types:
- str
ipv6:
type: int
description: Segment Size for IPv6
description: Segment Size for IPv6.
min: 64
max: 65475
convert_types:
Expand All @@ -1108,10 +1108,7 @@ keys:
valid_values:
- ingress
- egress
description: 'Optional direction (''ingress'', ''egress'') for tcp
mss ceiling
'
description: Optional direction ('ingress', 'egress') for tcp mss ceiling.
eos_cli:
type: str
description: Multiline String with EOS CLI rendered directly on the Dps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ keys:
keys:
name:
type: str
description: Only Dps1 is configurabled.
description: |-
"Dps1" is currently the only supported interface.
valid_values:
- Dps1
description:
Expand All @@ -25,39 +26,39 @@ keys:
type: bool
ip_address:
type: str
description: IPv4 address/mask
description: IPv4 address/mask.
flow_tracker:
type: dict
keys:
sampled:
type: str
description: Sampled flow tracker name
description: Sampled flow tracker name.
hardware:
type: str
description: Hardware flow tracker name
description: Hardware flow tracker name,
tcp_mss_ceiling:
type: dict
keys:
ipv4:
type: int
description: Segment Size for IPv4
description: Segment Size for IPv4.
min: 64
max: 65495
convert_types:
- str
ipv6:
type: int
description: Segment Size for IPv6
description: Segment Size for IPv6.
min: 64
max: 65475
convert_types:
- str
direction:
type: str
valid_values: ["ingress", "egress"]
description: |
Optional direction ('ingress', 'egress') for tcp mss ceiling
description: |-
Optional direction ('ingress', 'egress') for tcp mss ceiling.
eos_cli:
type: str
description: |
description: |-
Multiline String with EOS CLI rendered directly on the Dps interface in the final EOS configuration.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Use of this source code is governed by the Apache License 2.0
that can be found in the LICENSE file.
#}
{# j2lint: disable=V1 #}
{# doc - dps interfaces #}
{% if dps_interfaces is arista.avd.defined %}

Expand All @@ -17,21 +16,21 @@
{% set ip_address = dps_interface.ip_address | arista.avd.default("-") %}
{% set flow_trackers = [] %}
{% if dps_interface.flow_tracker.hardware is arista.avd.defined %}
{% do flow_trackers.append("* Hardware: " ~ dps_interface.flow_tracker.hardware) %}
{% do flow_trackers.append("Hardware: " ~ dps_interface.flow_tracker.hardware) %}
{% endif %}
{% set shutdown = dps_interface.shutdown | arista.avd.default("-") %}
{% if dps_interface.flow_tracker.sampled is arista.avd.defined %}
{% do flow_trackers.append("* Sampled: " ~ dps_interface.flow_tracker.sampled) %}
{% do flow_trackers.append("Sampled: " ~ dps_interface.flow_tracker.sampled) %}
{% endif %}
{% set tcp_mss_settings = [] %}
{% if dps_interface.tcp_mss_ceiling.ipv4 is arista.avd.defined %}
{% do tcp_mss_settings.append("* IPv4: " ~ dps_interface.tcp_mss_ceiling.ipv4) %}
{% do tcp_mss_settings.append("IPv4: " ~ dps_interface.tcp_mss_ceiling.ipv4) %}
{% endif %}
{% if dps_interface.tcp_mss_ceiling.ipv6 is arista.avd.defined %}
{% do tcp_mss_settings.append("* IPv6: " ~ dps_interface.tcp_mss_ceiling.ipv6) %}
{% do tcp_mss_settings.append("IPv6: " ~ dps_interface.tcp_mss_ceiling.ipv6) %}
{% endif %}
{% if dps_interface.tcp_mss_ceiling.direction is arista.avd.defined %}
{% do tcp_mss_settings.append("* Direction: " ~ dps_interface.tcp_mss_ceiling.direction) %}
{% do tcp_mss_settings.append("Direction: " ~ dps_interface.tcp_mss_ceiling.direction) %}
{% endif %}
| {{ dps_interface.name }} | {{ ip_address }} | {{ shutdown }} | {{ flow_trackers | join("<br>") }} | {{ tcp_mss_settings | join("<br>") }} |
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Use of this source code is governed by the Apache License 2.0
that can be found in the LICENSE file.
#}
{# j2lint: disable=V1 #}
{# eos - dps interfaces #}
{% for dps_interface in dps_interfaces | arista.avd.natural_sort('name') %}
!
Expand All @@ -25,7 +24,7 @@ interface {{ dps_interface.name }}
{% if dps_interface.ip_address is arista.avd.defined %}
ip address {{ dps_interface.ip_address }}
{% endif %}
{% if dps_interface.tcp_mss_ceiling is arista.avd.defined %}
{% if dps_interface.tcp_mss_ceiling.ipv4 is arista.avd.defined or dps_interface.tcp_mss_ceiling.ipv6 is arista.avd.defined %}
{% set tcp_mss_ceiling_cli = "tcp mss ceiling" %}
{% if dps_interface.tcp_mss_ceiling.ipv4 is arista.avd.defined %}
{% set tcp_mss_ceiling_cli = tcp_mss_ceiling_cli ~ " ipv4 " ~ dps_interface.tcp_mss_ceiling.ipv4 %}
Expand Down

0 comments on commit a542649

Please sign in to comment.