Skip to content

Commit 634511e

Browse files
committed
Add l2vpn pw class resource and data source
1 parent d415037 commit 634511e

File tree

15 files changed

+1227
-0
lines changed

15 files changed

+1227
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Add `nexthop_trigger_delay_critical` and `nexthop_trigger_delay_non_critical` attributes to `iosxr_router_bgp_address_family` resource and data source
77
- Add `advertisement_interval` attributes to `iosxr_router_bgp`, `iosxr_router_bgp_vrf` and `iosxr_router_bgp_neighbor_group` resources and data sources
88
- Add `load_balancing_flow_src_dst_mac` and `load_balancing_flow_src_dst_ip` attributes to `iosxr_l2vpn` resource and data source
9+
- Add `iosxr_l2vpn_pw_class` resource and data source
910

1011
## 0.2.3
1112

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "iosxr_l2vpn_pw_class Data Source - terraform-provider-iosxr"
4+
subcategory: "L2VPN"
5+
description: |-
6+
This data source can read the L2VPN PW Class configuration.
7+
---
8+
9+
# iosxr_l2vpn_pw_class (Data Source)
10+
11+
This data source can read the L2VPN PW Class configuration.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "iosxr_l2vpn_pw_class" "example" {
17+
name = "PWC1"
18+
}
19+
```
20+
21+
<!-- schema generated by tfplugindocs -->
22+
## Schema
23+
24+
### Required
25+
26+
- `name` (String) Pseudowire class template
27+
28+
### Optional
29+
30+
- `device` (String) A device name from the provider configuration.
31+
32+
### Read-Only
33+
34+
- `encapsulation_mpls` (Boolean) Set pseudowire encapsulation to MPLS
35+
- `encapsulation_mpls_load_balancing_flow_label_both` (Boolean) Insert/Discard Flow label on transmit/recceive
36+
- `encapsulation_mpls_load_balancing_flow_label_both_static` (Boolean) Set Flow label parameters statically
37+
- `encapsulation_mpls_load_balancing_flow_label_code_one7` (Boolean) Legacy code value
38+
- `encapsulation_mpls_load_balancing_flow_label_code_one7_disable` (Boolean) Disables sending code 17 TLV
39+
- `encapsulation_mpls_load_balancing_flow_label_receive` (Boolean) Discard Flow label on receive
40+
- `encapsulation_mpls_load_balancing_flow_label_receive_static` (Boolean) Set Flow label parameters statically
41+
- `encapsulation_mpls_load_balancing_flow_label_transmit` (Boolean) Insert Flow label on transmit
42+
- `encapsulation_mpls_load_balancing_flow_label_transmit_static` (Boolean) Set Flow label parameters statically
43+
- `encapsulation_mpls_load_balancing_pw_label` (Boolean) Enable PW VC label based load balancing
44+
- `encapsulation_mpls_transport_mode_ethernet` (Boolean) Ethernet port mode
45+
- `encapsulation_mpls_transport_mode_passthrough` (Boolean) passthrough incoming tags
46+
- `encapsulation_mpls_transport_mode_vlan` (Boolean) Vlan tagged mode
47+
- `id` (String) The path of the retrieved object.

docs/guides/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ description: |-
1515
- Add `nexthop_trigger_delay_critical` and `nexthop_trigger_delay_non_critical` attributes to `iosxr_router_bgp_address_family` resource and data source
1616
- Add `advertisement_interval` attributes to `iosxr_router_bgp`, `iosxr_router_bgp_vrf` and `iosxr_router_bgp_neighbor_group` resources and data sources
1717
- Add `load_balancing_flow_src_dst_mac` and `load_balancing_flow_src_dst_ip` attributes to `iosxr_l2vpn` resource and data source
18+
- Add `iosxr_l2vpn_pw_class` resource and data source
1819

1920
## 0.2.3
2021

docs/resources/l2vpn_pw_class.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "iosxr_l2vpn_pw_class Resource - terraform-provider-iosxr"
4+
subcategory: "L2VPN"
5+
description: |-
6+
This resource can manage the L2VPN PW Class configuration.
7+
---
8+
9+
# iosxr_l2vpn_pw_class (Resource)
10+
11+
This resource can manage the L2VPN PW Class configuration.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "iosxr_l2vpn_pw_class" "example" {
17+
name = "PWC1"
18+
encapsulation_mpls = true
19+
encapsulation_mpls_transport_mode_ethernet = true
20+
encapsulation_mpls_transport_mode_vlan = false
21+
encapsulation_mpls_transport_mode_passthrough = false
22+
encapsulation_mpls_load_balancing_pw_label = true
23+
encapsulation_mpls_load_balancing_flow_label_both = true
24+
encapsulation_mpls_load_balancing_flow_label_both_static = true
25+
encapsulation_mpls_load_balancing_flow_label_code_one7 = true
26+
encapsulation_mpls_load_balancing_flow_label_code_one7_disable = true
27+
}
28+
```
29+
30+
<!-- schema generated by tfplugindocs -->
31+
## Schema
32+
33+
### Required
34+
35+
- `name` (String) Pseudowire class template
36+
37+
### Optional
38+
39+
- `delete_mode` (String) Configure behavior when deleting/destroying the resource. Either delete the entire object (YANG container) being managed, or only delete the individual resource attributes configured explicitly and leave everything else as-is. Default value is `all`.
40+
- Choices: `all`, `attributes`
41+
- `device` (String) A device name from the provider configuration.
42+
- `encapsulation_mpls` (Boolean) Set pseudowire encapsulation to MPLS
43+
- `encapsulation_mpls_load_balancing_flow_label_both` (Boolean) Insert/Discard Flow label on transmit/recceive
44+
- `encapsulation_mpls_load_balancing_flow_label_both_static` (Boolean) Set Flow label parameters statically
45+
- `encapsulation_mpls_load_balancing_flow_label_code_one7` (Boolean) Legacy code value
46+
- `encapsulation_mpls_load_balancing_flow_label_code_one7_disable` (Boolean) Disables sending code 17 TLV
47+
- `encapsulation_mpls_load_balancing_flow_label_receive` (Boolean) Discard Flow label on receive
48+
- `encapsulation_mpls_load_balancing_flow_label_receive_static` (Boolean) Set Flow label parameters statically
49+
- `encapsulation_mpls_load_balancing_flow_label_transmit` (Boolean) Insert Flow label on transmit
50+
- `encapsulation_mpls_load_balancing_flow_label_transmit_static` (Boolean) Set Flow label parameters statically
51+
- `encapsulation_mpls_load_balancing_pw_label` (Boolean) Enable PW VC label based load balancing
52+
- `encapsulation_mpls_transport_mode_ethernet` (Boolean) Ethernet port mode
53+
- `encapsulation_mpls_transport_mode_passthrough` (Boolean) passthrough incoming tags
54+
- `encapsulation_mpls_transport_mode_vlan` (Boolean) Vlan tagged mode
55+
56+
### Read-Only
57+
58+
- `id` (String) The path of the object.
59+
60+
## Import
61+
62+
Import is supported using the following syntax:
63+
64+
```shell
65+
terraform import iosxr_l2vpn_pw_class.example "Cisco-IOS-XR-um-l2vpn-cfg:/l2vpn/pw-classes/pw-class[pw-class-name=PWC1]"
66+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "iosxr_l2vpn_pw_class" "example" {
2+
name = "PWC1"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import iosxr_l2vpn_pw_class.example "Cisco-IOS-XR-um-l2vpn-cfg:/l2vpn/pw-classes/pw-class[pw-class-name=PWC1]"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resource "iosxr_l2vpn_pw_class" "example" {
2+
name = "PWC1"
3+
encapsulation_mpls = true
4+
encapsulation_mpls_transport_mode_ethernet = true
5+
encapsulation_mpls_transport_mode_vlan = false
6+
encapsulation_mpls_transport_mode_passthrough = false
7+
encapsulation_mpls_load_balancing_pw_label = true
8+
encapsulation_mpls_load_balancing_flow_label_both = true
9+
encapsulation_mpls_load_balancing_flow_label_both_static = true
10+
encapsulation_mpls_load_balancing_flow_label_code_one7 = true
11+
encapsulation_mpls_load_balancing_flow_label_code_one7_disable = true
12+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: L2VPN PW Class
3+
path: Cisco-IOS-XR-um-l2vpn-cfg:/l2vpn/pw-classes/pw-class[pw-class-name=%s]
4+
doc_category: L2VPN
5+
attributes:
6+
- yang_name: pw-class-name
7+
tf_name: name
8+
example: PWC1
9+
- yang_name: encapsulation/mpls
10+
example: true
11+
- yang_name: encapsulation/mpls/transport-mode/ethernet
12+
example: true
13+
- yang_name: encapsulation/mpls/transport-mode/vlan
14+
example: false
15+
- yang_name: encapsulation/mpls/transport-mode/passthrough
16+
example: false
17+
- yang_name: encapsulation/mpls/load-balancing/pw-label
18+
example: true
19+
- yang_name: encapsulation/mpls/load-balancing/flow-label/transmit
20+
example: false
21+
exclude_test: true
22+
- yang_name: encapsulation/mpls/load-balancing/flow-label/transmit/static
23+
example: false
24+
exclude_test: true
25+
- yang_name: encapsulation/mpls/load-balancing/flow-label/receive
26+
example: false
27+
exclude_test: true
28+
- yang_name: encapsulation/mpls/load-balancing/flow-label/receive/static
29+
example: false
30+
exclude_test: true
31+
- yang_name: encapsulation/mpls/load-balancing/flow-label/both
32+
example: true
33+
- yang_name: encapsulation/mpls/load-balancing/flow-label/both/static
34+
example: true
35+
- yang_name: encapsulation/mpls/load-balancing/flow-label/code/one7
36+
example: true
37+
- yang_name: encapsulation/mpls/load-balancing/flow-label/code/one7/disable
38+
example: true

internal/provider/data_source_iosxr_l2vpn_pw_class.go

Lines changed: 158 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)