Skip to content

Commit bb30cf8

Browse files
Enhance flow resources (#338)
1 parent 5d1b882 commit bb30cf8

15 files changed

+698
-33
lines changed

docs/data-sources/flow_exporter.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ data "iosxe_flow_exporter" "example" {
4040
- `option_interface_table_timeout` (Number) Option resend time
4141
- `option_sampler_table` (Boolean) Export Sampler Option
4242
- `option_vrf_table_timeout` (Number) Option resend time
43+
- `source_five_gigabit_ethernet` (String) Five GigabitEthernet
44+
- `source_forty_gigabit_ethernet` (String) Forty GigabitEthernet
45+
- `source_gigabit_ethernet` (String) GigabitEthernet IEEE 802.3z
46+
- `source_hundred_gigabit_ethernet` (String) Hundred GigabitEthernet
4347
- `source_loopback` (Number) Loopback interface
48+
- `source_port_channel` (Number) Ethernet Channel of interfaces
49+
- `source_ten_gigabit_ethernet` (String) Ten Gigabit Ethernet
50+
- `source_twenty_five_gigabit_ethernet` (String) Twenty Five GigabitEthernet
51+
- `source_two_gigabit_ethernet` (String) Two GigabitEthernet
52+
- `source_vlan` (Number) Iosxr Vlans
4453
- `template_data_timeout` (Number) Resend data based on a timeout
4554
- `transport_udp` (Number) UDP transport protocol

docs/data-sources/flow_record.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,19 @@ data "iosxe_flow_record" "example" {
5151
- `match_connection_server_ipv4_address` (Boolean) IPv4 address of the flow responder
5252
- `match_connection_server_ipv6_address` (Boolean) IPv6 address of the flow responder
5353
- `match_connection_server_transport_port` (Boolean) Transport port of the flow responder
54+
- `match_datalink_destination_vlan_id` (Boolean) Match destination VLAN ID, available on router platforms (C8K, CSR1K)
55+
- `match_datalink_mac_destination_address_input` (Boolean) Destination MAC address from packet at input
56+
- `match_datalink_mac_source_address_input` (Boolean) Source MAC address from packet at input
57+
- `match_datalink_source_vlan_id` (Boolean) Match source VLAN ID, available on router platforms (C8K, CSR1K)
58+
- `match_datalink_vlan` (String) Match VLAN input/output, available on switch platforms (C9K)
5459
- `match_flow_direction` (Boolean) Direction the flow was monitored in
5560
- `match_flow_observation_point` (Boolean) Observation point ID
5661
- `match_interface_input` (Boolean) The input interface
5762
- `match_ipv4_destination_address` (Boolean) IPv4 destination address
5863
- `match_ipv4_protocol` (Boolean) IPv4 protocol
5964
- `match_ipv4_source_address` (Boolean) IPv4 source address
6065
- `match_ipv4_tos` (Boolean) IPv4 type of service
66+
- `match_ipv4_ttl` (Boolean) IPv4 TTL
6167
- `match_ipv4_version` (Boolean) IP version from IPv4 header
6268
- `match_ipv6_destination_address` (Boolean) IPv6 destination address
6369
- `match_ipv6_protocol` (Boolean) IPv6 payload protocol

docs/resources/flow_exporter.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,19 @@ resource "iosxe_flow_exporter" "example" {
4848
- `option_sampler_table` (Boolean) Export Sampler Option
4949
- `option_vrf_table_timeout` (Number) Option resend time
5050
- Range: `1`-`86400`
51+
- `source_five_gigabit_ethernet` (String) Five GigabitEthernet
52+
- `source_forty_gigabit_ethernet` (String) Forty GigabitEthernet
53+
- `source_gigabit_ethernet` (String) GigabitEthernet IEEE 802.3z
54+
- `source_hundred_gigabit_ethernet` (String) Hundred GigabitEthernet
5155
- `source_loopback` (Number) Loopback interface
5256
- Range: `0`-`2147483647`
57+
- `source_port_channel` (Number) Ethernet Channel of interfaces
58+
- Range: `0`-`4294967295`
59+
- `source_ten_gigabit_ethernet` (String) Ten Gigabit Ethernet
60+
- `source_twenty_five_gigabit_ethernet` (String) Twenty Five GigabitEthernet
61+
- `source_two_gigabit_ethernet` (String) Two GigabitEthernet
62+
- `source_vlan` (Number) Iosxr Vlans
63+
- Range: `0`-`65535`
5364
- `template_data_timeout` (Number) Resend data based on a timeout
5465
- Range: `1`-`86400`
5566
- `transport_udp` (Number) UDP transport protocol

docs/resources/flow_record.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ This resource can manage the Flow Record configuration.
1414

1515
```terraform
1616
resource "iosxe_flow_record" "example" {
17-
name = "FNF1"
18-
description = "My flow record"
19-
match_ipv4_source_address = true
20-
match_ipv4_destination_address = true
21-
match_ipv4_protocol = true
22-
match_ipv4_tos = true
23-
match_transport_source_port = true
24-
match_transport_destination_port = true
25-
match_interface_input = true
26-
match_flow_direction = true
27-
collect_interface_output = true
28-
collect_counter_bytes_long = true
29-
collect_counter_packets_long = true
30-
collect_transport_tcp_flags = true
31-
collect_timestamp_absolute_first = true
32-
collect_timestamp_absolute_last = true
17+
name = "FNF1"
18+
description = "My flow record"
19+
match_ipv4_source_address = true
20+
match_ipv4_destination_address = true
21+
match_ipv4_protocol = true
22+
match_ipv4_tos = true
23+
match_transport_source_port = true
24+
match_transport_destination_port = true
25+
match_interface_input = true
26+
match_flow_direction = true
27+
collect_interface_output = true
28+
collect_counter_bytes_long = true
29+
collect_counter_packets_long = true
30+
collect_transport_tcp_flags = true
31+
collect_timestamp_absolute_first = true
32+
collect_timestamp_absolute_last = true
33+
match_datalink_mac_source_address_input = true
34+
match_datalink_mac_destination_address_input = true
35+
match_ipv4_ttl = true
3336
}
3437
```
3538

@@ -64,13 +67,20 @@ resource "iosxe_flow_record" "example" {
6467
- `match_connection_server_ipv4_address` (Boolean) IPv4 address of the flow responder
6568
- `match_connection_server_ipv6_address` (Boolean) IPv6 address of the flow responder
6669
- `match_connection_server_transport_port` (Boolean) Transport port of the flow responder
70+
- `match_datalink_destination_vlan_id` (Boolean) Match destination VLAN ID, available on router platforms (C8K, CSR1K)
71+
- `match_datalink_mac_destination_address_input` (Boolean) Destination MAC address from packet at input
72+
- `match_datalink_mac_source_address_input` (Boolean) Source MAC address from packet at input
73+
- `match_datalink_source_vlan_id` (Boolean) Match source VLAN ID, available on router platforms (C8K, CSR1K)
74+
- `match_datalink_vlan` (String) Match VLAN input/output, available on switch platforms (C9K)
75+
- Choices: `input`, `output`
6776
- `match_flow_direction` (Boolean) Direction the flow was monitored in
6877
- `match_flow_observation_point` (Boolean) Observation point ID
6978
- `match_interface_input` (Boolean) The input interface
7079
- `match_ipv4_destination_address` (Boolean) IPv4 destination address
7180
- `match_ipv4_protocol` (Boolean) IPv4 protocol
7281
- `match_ipv4_source_address` (Boolean) IPv4 source address
7382
- `match_ipv4_tos` (Boolean) IPv4 type of service
83+
- `match_ipv4_ttl` (Boolean) IPv4 TTL
7484
- `match_ipv4_version` (Boolean) IP version from IPv4 header
7585
- `match_ipv6_destination_address` (Boolean) IPv6 destination address
7686
- `match_ipv6_protocol` (Boolean) IPv6 payload protocol
Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
resource "iosxe_flow_record" "example" {
2-
name = "FNF1"
3-
description = "My flow record"
4-
match_ipv4_source_address = true
5-
match_ipv4_destination_address = true
6-
match_ipv4_protocol = true
7-
match_ipv4_tos = true
8-
match_transport_source_port = true
9-
match_transport_destination_port = true
10-
match_interface_input = true
11-
match_flow_direction = true
12-
collect_interface_output = true
13-
collect_counter_bytes_long = true
14-
collect_counter_packets_long = true
15-
collect_transport_tcp_flags = true
16-
collect_timestamp_absolute_first = true
17-
collect_timestamp_absolute_last = true
2+
name = "FNF1"
3+
description = "My flow record"
4+
match_ipv4_source_address = true
5+
match_ipv4_destination_address = true
6+
match_ipv4_protocol = true
7+
match_ipv4_tos = true
8+
match_transport_source_port = true
9+
match_transport_destination_port = true
10+
match_interface_input = true
11+
match_flow_direction = true
12+
collect_interface_output = true
13+
collect_counter_bytes_long = true
14+
collect_counter_packets_long = true
15+
collect_transport_tcp_flags = true
16+
collect_timestamp_absolute_first = true
17+
collect_timestamp_absolute_last = true
18+
match_datalink_mac_source_address_input = true
19+
match_datalink_mac_destination_address_input = true
20+
match_ipv4_ttl = true
1821
}

gen/definitions/flow_exporter.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,51 @@ attributes:
1515
xpath: source/Loopback
1616
tf_name: source_loopback
1717
example: 123
18+
- yang_name: source/interface-choice/GigabitEthernet/GigabitEthernet
19+
xpath: source/GigabitEthernet
20+
tf_name: source_gigabit_ethernet
21+
exclude_test: true
22+
example: 0/0/1
23+
- yang_name: source/interface-choice/TwoGigabitEthernet/TwoGigabitEthernet
24+
xpath: source/TwoGigabitEthernet
25+
tf_name: source_two_gigabit_ethernet
26+
exclude_test: true
27+
example: 0/0/1
28+
- yang_name: source/interface-choice/FiveGigabitEthernet/FiveGigabitEthernet
29+
xpath: source/FiveGigabitEthernet
30+
tf_name: source_five_gigabit_ethernet
31+
exclude_test: true
32+
example: 0/0/1
33+
- yang_name: source/interface-choice/TenGigabitEthernet/TenGigabitEthernet
34+
xpath: source/TenGigabitEthernet
35+
tf_name: source_ten_gigabit_ethernet
36+
exclude_test: true
37+
example: 0/0/1
38+
- yang_name: source/interface-choice/TwentyFiveGigE/TwentyFiveGigE
39+
xpath: source/TwentyFiveGigE
40+
tf_name: source_twenty_five_gigabit_ethernet
41+
exclude_test: true
42+
example: 0/0/1
43+
- yang_name: source/interface-choice/FortyGigabitEthernet/FortyGigabitEthernet
44+
xpath: source/FortyGigabitEthernet
45+
tf_name: source_forty_gigabit_ethernet
46+
exclude_test: true
47+
example: 0/0/1
48+
- yang_name: source/interface-choice/HundredGigE/HundredGigE
49+
xpath: source/HundredGigE
50+
tf_name: source_hundred_gigabit_ethernet
51+
exclude_test: true
52+
example: 0/0/1
53+
- yang_name: source/interface-choice/Vlan/Vlan
54+
xpath: source/Vlan
55+
tf_name: source_vlan
56+
exclude_test: true
57+
example: 100
58+
- yang_name: source/interface-choice/Port-channel/Port-channel
59+
xpath: source/Port-channel
60+
tf_name: source_port_channel
61+
exclude_test: true
62+
example: 1
1863
- yang_name: transport/udp
1964
example: 655
2065
- yang_name: template/data/timeout

gen/definitions/flow_record.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ attributes:
8585
- yang_name: collect/connection/server/counter/packets/long
8686
example: true
8787
exclude_test: true
88+
- yang_name: match/datalink/mac/source/address/input
89+
example: true
90+
- yang_name: match/datalink/mac/destination/address/input
91+
example: true
92+
- yang_name: match/datalink/vlan
93+
description: Match VLAN input/output, available on switch platforms (C9K)
94+
example: input
95+
test_tags: [C9000V]
96+
- yang_name: match/datalink/source-vlan-id
97+
description: Match source VLAN ID, available on router platforms (C8K, CSR1K)
98+
example: true
99+
test_tags: [C8000V]
100+
- yang_name: match/datalink/destination-vlan-id
101+
description: Match destination VLAN ID, available on router platforms (C8K, CSR1K)
102+
example: true
103+
test_tags: [C8000V]
104+
exclude_test: true
105+
- yang_name: match/ipv4/ttl
106+
example: true
88107
- yang_name: collect/datalink/mac/source/address/input
89108
example: true
90109
exclude_test: true

internal/provider/data_source_iosxe_flow_exporter.go

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/data_source_iosxe_flow_record.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/data_source_iosxe_flow_record_test.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)