Skip to content

Commit

Permalink
Add l2vpn pw class resource and data source
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jul 31, 2023
1 parent d415037 commit 634511e
Show file tree
Hide file tree
Showing 15 changed files with 1,227 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Add `nexthop_trigger_delay_critical` and `nexthop_trigger_delay_non_critical` attributes to `iosxr_router_bgp_address_family` resource and data source
- Add `advertisement_interval` attributes to `iosxr_router_bgp`, `iosxr_router_bgp_vrf` and `iosxr_router_bgp_neighbor_group` resources and data sources
- Add `load_balancing_flow_src_dst_mac` and `load_balancing_flow_src_dst_ip` attributes to `iosxr_l2vpn` resource and data source
- Add `iosxr_l2vpn_pw_class` resource and data source

## 0.2.3

Expand Down
47 changes: 47 additions & 0 deletions docs/data-sources/l2vpn_pw_class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "iosxr_l2vpn_pw_class Data Source - terraform-provider-iosxr"
subcategory: "L2VPN"
description: |-
This data source can read the L2VPN PW Class configuration.
---

# iosxr_l2vpn_pw_class (Data Source)

This data source can read the L2VPN PW Class configuration.

## Example Usage

```terraform
data "iosxr_l2vpn_pw_class" "example" {
name = "PWC1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Pseudowire class template

### Optional

- `device` (String) A device name from the provider configuration.

### Read-Only

- `encapsulation_mpls` (Boolean) Set pseudowire encapsulation to MPLS
- `encapsulation_mpls_load_balancing_flow_label_both` (Boolean) Insert/Discard Flow label on transmit/recceive
- `encapsulation_mpls_load_balancing_flow_label_both_static` (Boolean) Set Flow label parameters statically
- `encapsulation_mpls_load_balancing_flow_label_code_one7` (Boolean) Legacy code value
- `encapsulation_mpls_load_balancing_flow_label_code_one7_disable` (Boolean) Disables sending code 17 TLV
- `encapsulation_mpls_load_balancing_flow_label_receive` (Boolean) Discard Flow label on receive
- `encapsulation_mpls_load_balancing_flow_label_receive_static` (Boolean) Set Flow label parameters statically
- `encapsulation_mpls_load_balancing_flow_label_transmit` (Boolean) Insert Flow label on transmit
- `encapsulation_mpls_load_balancing_flow_label_transmit_static` (Boolean) Set Flow label parameters statically
- `encapsulation_mpls_load_balancing_pw_label` (Boolean) Enable PW VC label based load balancing
- `encapsulation_mpls_transport_mode_ethernet` (Boolean) Ethernet port mode
- `encapsulation_mpls_transport_mode_passthrough` (Boolean) passthrough incoming tags
- `encapsulation_mpls_transport_mode_vlan` (Boolean) Vlan tagged mode
- `id` (String) The path of the retrieved object.
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ description: |-
- Add `nexthop_trigger_delay_critical` and `nexthop_trigger_delay_non_critical` attributes to `iosxr_router_bgp_address_family` resource and data source
- Add `advertisement_interval` attributes to `iosxr_router_bgp`, `iosxr_router_bgp_vrf` and `iosxr_router_bgp_neighbor_group` resources and data sources
- Add `load_balancing_flow_src_dst_mac` and `load_balancing_flow_src_dst_ip` attributes to `iosxr_l2vpn` resource and data source
- Add `iosxr_l2vpn_pw_class` resource and data source

## 0.2.3

Expand Down
66 changes: 66 additions & 0 deletions docs/resources/l2vpn_pw_class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "iosxr_l2vpn_pw_class Resource - terraform-provider-iosxr"
subcategory: "L2VPN"
description: |-
This resource can manage the L2VPN PW Class configuration.
---

# iosxr_l2vpn_pw_class (Resource)

This resource can manage the L2VPN PW Class configuration.

## Example Usage

```terraform
resource "iosxr_l2vpn_pw_class" "example" {
name = "PWC1"
encapsulation_mpls = true
encapsulation_mpls_transport_mode_ethernet = true
encapsulation_mpls_transport_mode_vlan = false
encapsulation_mpls_transport_mode_passthrough = false
encapsulation_mpls_load_balancing_pw_label = true
encapsulation_mpls_load_balancing_flow_label_both = true
encapsulation_mpls_load_balancing_flow_label_both_static = true
encapsulation_mpls_load_balancing_flow_label_code_one7 = true
encapsulation_mpls_load_balancing_flow_label_code_one7_disable = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Pseudowire class template

### Optional

- `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`.
- Choices: `all`, `attributes`
- `device` (String) A device name from the provider configuration.
- `encapsulation_mpls` (Boolean) Set pseudowire encapsulation to MPLS
- `encapsulation_mpls_load_balancing_flow_label_both` (Boolean) Insert/Discard Flow label on transmit/recceive
- `encapsulation_mpls_load_balancing_flow_label_both_static` (Boolean) Set Flow label parameters statically
- `encapsulation_mpls_load_balancing_flow_label_code_one7` (Boolean) Legacy code value
- `encapsulation_mpls_load_balancing_flow_label_code_one7_disable` (Boolean) Disables sending code 17 TLV
- `encapsulation_mpls_load_balancing_flow_label_receive` (Boolean) Discard Flow label on receive
- `encapsulation_mpls_load_balancing_flow_label_receive_static` (Boolean) Set Flow label parameters statically
- `encapsulation_mpls_load_balancing_flow_label_transmit` (Boolean) Insert Flow label on transmit
- `encapsulation_mpls_load_balancing_flow_label_transmit_static` (Boolean) Set Flow label parameters statically
- `encapsulation_mpls_load_balancing_pw_label` (Boolean) Enable PW VC label based load balancing
- `encapsulation_mpls_transport_mode_ethernet` (Boolean) Ethernet port mode
- `encapsulation_mpls_transport_mode_passthrough` (Boolean) passthrough incoming tags
- `encapsulation_mpls_transport_mode_vlan` (Boolean) Vlan tagged mode

### Read-Only

- `id` (String) The path of the object.

## Import

Import is supported using the following syntax:

```shell
terraform import iosxr_l2vpn_pw_class.example "Cisco-IOS-XR-um-l2vpn-cfg:/l2vpn/pw-classes/pw-class[pw-class-name=PWC1]"
```
3 changes: 3 additions & 0 deletions examples/data-sources/iosxr_l2vpn_pw_class/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "iosxr_l2vpn_pw_class" "example" {
name = "PWC1"
}
1 change: 1 addition & 0 deletions examples/resources/iosxr_l2vpn_pw_class/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import iosxr_l2vpn_pw_class.example "Cisco-IOS-XR-um-l2vpn-cfg:/l2vpn/pw-classes/pw-class[pw-class-name=PWC1]"
12 changes: 12 additions & 0 deletions examples/resources/iosxr_l2vpn_pw_class/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "iosxr_l2vpn_pw_class" "example" {
name = "PWC1"
encapsulation_mpls = true
encapsulation_mpls_transport_mode_ethernet = true
encapsulation_mpls_transport_mode_vlan = false
encapsulation_mpls_transport_mode_passthrough = false
encapsulation_mpls_load_balancing_pw_label = true
encapsulation_mpls_load_balancing_flow_label_both = true
encapsulation_mpls_load_balancing_flow_label_both_static = true
encapsulation_mpls_load_balancing_flow_label_code_one7 = true
encapsulation_mpls_load_balancing_flow_label_code_one7_disable = true
}
38 changes: 38 additions & 0 deletions gen/definitions/l2vpn_pw_class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: L2VPN PW Class
path: Cisco-IOS-XR-um-l2vpn-cfg:/l2vpn/pw-classes/pw-class[pw-class-name=%s]
doc_category: L2VPN
attributes:
- yang_name: pw-class-name
tf_name: name
example: PWC1
- yang_name: encapsulation/mpls
example: true
- yang_name: encapsulation/mpls/transport-mode/ethernet
example: true
- yang_name: encapsulation/mpls/transport-mode/vlan
example: false
- yang_name: encapsulation/mpls/transport-mode/passthrough
example: false
- yang_name: encapsulation/mpls/load-balancing/pw-label
example: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/transmit
example: false
exclude_test: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/transmit/static
example: false
exclude_test: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/receive
example: false
exclude_test: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/receive/static
example: false
exclude_test: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/both
example: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/both/static
example: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/code/one7
example: true
- yang_name: encapsulation/mpls/load-balancing/flow-label/code/one7/disable
example: true
158 changes: 158 additions & 0 deletions internal/provider/data_source_iosxr_l2vpn_pw_class.go

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

Loading

0 comments on commit 634511e

Please sign in to comment.