Skip to content

Commit

Permalink
Add support to apply flow monitors to interfaces (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
swarudka authored Mar 6, 2024
1 parent 65134bd commit f92e531
Show file tree
Hide file tree
Showing 10 changed files with 191 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/data-sources/interface_ethernet.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ data "iosxe_interface_ethernet" "example" {
- `ip_arp_inspection_trust` (Boolean) Configure Trust state
- `ip_dhcp_relay_source_interface` (String) Set source interface for relayed messages
- `ip_dhcp_snooping_trust` (Boolean) DHCP Snooping trust config
- `ip_flow_monitor` (Attributes List) Apply a Flow Monitor (see [below for nested schema](#nestedatt--ip_flow_monitor))
- `ip_proxy_arp` (Boolean) Enable proxy ARP
- `ip_redirects` (Boolean) Enable sending ICMP Redirect messages
- `ip_unreachables` (Boolean) Enable sending ICMP Unreachable messages
Expand Down Expand Up @@ -144,6 +145,15 @@ Read-Only:
- `vrf` (String) VRF name for helper-address (if different from interface VRF)


<a id="nestedatt--ip_flow_monitor"></a>
### Nested Schema for `ip_flow_monitor`

Read-Only:

- `direction` (String)
- `name` (String) User defined


<a id="nestedatt--ipv6_addresses"></a>
### Nested Schema for `ipv6_addresses`

Expand Down
19 changes: 19 additions & 0 deletions docs/resources/interface_ethernet.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ resource "iosxe_interface_ethernet" "example" {
spanning_tree_link_type = "point-to-point"
service_policy_input = "POLICY1"
service_policy_output = "POLICY1"
ip_flow_monitor = [
{
name = "TEST"
direction = "INPUT"
}
]
}
```

Expand Down Expand Up @@ -160,6 +166,7 @@ resource "iosxe_interface_ethernet" "example" {
- `ip_arp_inspection_trust` (Boolean) Configure Trust state
- `ip_dhcp_relay_source_interface` (String) Set source interface for relayed messages
- `ip_dhcp_snooping_trust` (Boolean) DHCP Snooping trust config
- `ip_flow_monitor` (Attributes List) Apply a Flow Monitor (see [below for nested schema](#nestedatt--ip_flow_monitor))
- `ip_proxy_arp` (Boolean) Enable proxy ARP
- `ip_redirects` (Boolean) Enable sending ICMP Redirect messages
- `ip_unreachables` (Boolean) Enable sending ICMP Unreachable messages
Expand Down Expand Up @@ -218,6 +225,18 @@ Optional:
- `vrf` (String) VRF name for helper-address (if different from interface VRF)


<a id="nestedatt--ip_flow_monitor"></a>
### Nested Schema for `ip_flow_monitor`

Required:

- `name` (String) User defined

Optional:

- `direction` (String) - Choices: `input`, `output`


<a id="nestedatt--ipv6_addresses"></a>
### Nested Schema for `ipv6_addresses`

Expand Down
6 changes: 6 additions & 0 deletions examples/resources/iosxe_interface_ethernet/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ resource "iosxe_interface_ethernet" "example" {
spanning_tree_link_type = "point-to-point"
service_policy_input = "POLICY1"
service_policy_output = "POLICY1"
ip_flow_monitor = [
{
name = "TEST"
direction = "INPUT"
}
]
}
9 changes: 9 additions & 0 deletions gen/definitions/interface_ethernet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,15 @@ attributes:
example: POLICY1
- yang_name: Cisco-IOS-XE-policy:service-policy/output
example: POLICY1
- yang_name: ip/Cisco-IOS-XE-flow:flow/monitor-new
tf_name: ip_flow_monitor
type: List
attributes:
- yang_name: name
id: true
example: TEST
- yang_name: direction
example: INPUT

test_prerequisites:
- path: Cisco-IOS-XE-native:native/vrf/definition=VRF1
Expand Down
1 change: 1 addition & 0 deletions gen/load_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var models = []string{
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-aaa.yang",
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-device-tracking.yang",
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-nd.yang",
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-flow.yang",
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-multicast.yang",
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-l2vpn.yang",
"https://raw.githubusercontent.com/YangModels/yang/main/vendor/cisco/xe/1791/Cisco-IOS-XE-ethernet.yang",
Expand Down
16 changes: 16 additions & 0 deletions internal/provider/data_source_iosxe_interface_ethernet.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 99 additions & 0 deletions internal/provider/model_iosxe_interface_ethernet.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions internal/provider/resource_iosxe_interface_ethernet.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions internal/provider/resource_iosxe_interface_ethernet_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f92e531

Please sign in to comment.