Skip to content

Commit 5e13f3f

Browse files
Add bgp peer template support (#317)
1 parent 7a257c6 commit 5e13f3f

18 files changed

+1376
-0
lines changed

docs/data-sources/bgp_neighbor.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ data "iosxe_bgp_neighbor" "example" {
4747
- `fall_over_default_route_map` (String)
4848
- `fall_over_maximum_metric_route_map` (String)
4949
- `id` (String) The path of the retrieved object.
50+
- `inherit_peer_session` (String) Inherit a peer-session template
5051
- `local_as` (String)
5152
- `local_as_dual_as` (Boolean) Accept either real AS or local AS from the ebgp peer
5253
- `local_as_no_prepend` (Boolean) Do not prepend local-as to updates from ebgp peers
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "iosxe_bgp_peer_session_template Data Source - terraform-provider-iosxe"
4+
subcategory: "BGP"
5+
description: |-
6+
This data source can read the BGP Peer Session Template configuration.
7+
---
8+
9+
# iosxe_bgp_peer_session_template (Data Source)
10+
11+
This data source can read the BGP Peer Session Template configuration.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "iosxe_bgp_peer_session_template" "example" {
17+
asn = "65000"
18+
template_name = "PEER_SESSION_TEMPLATE_1"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `asn` (String)
28+
- `template_name` (String)
29+
30+
### Optional
31+
32+
- `device` (String) A device name from the provider configuration.
33+
34+
### Read-Only
35+
36+
- `description` (String) Neighbor specific description
37+
- `disable_connected_check` (Boolean) one-hop away EBGP peer using loopback address
38+
- `ebgp_multihop` (Boolean) Allow EBGP neighbors not on directly connected networks. For single-hop ebgp peers, delete ebgp-multihop directly.
39+
- `ebgp_multihop_max_hop` (Number)
40+
- `id` (String) The path of the retrieved object.
41+
- `inherit_peer_session` (String) Inherit a peer-session template
42+
- `remote_as` (String) Specify a BGP neighbor remote-as
43+
- `update_source_interface_loopback` (Number) Loopback interface

docs/resources/bgp_neighbor.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ resource "iosxe_bgp_neighbor" "example" {
6565
- `fall_over_default_enable` (Boolean)
6666
- `fall_over_default_route_map` (String)
6767
- `fall_over_maximum_metric_route_map` (String)
68+
- `inherit_peer_session` (String) Inherit a peer-session template
6869
- `local_as` (String)
6970
- `local_as_dual_as` (Boolean) Accept either real AS or local AS from the ebgp peer
7071
- `local_as_no_prepend` (Boolean) Do not prepend local-as to updates from ebgp peers
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "iosxe_bgp_peer_session_template Resource - terraform-provider-iosxe"
4+
subcategory: "BGP"
5+
description: |-
6+
This resource can manage the BGP Peer Session Template configuration.
7+
---
8+
9+
# iosxe_bgp_peer_session_template (Resource)
10+
11+
This resource can manage the BGP Peer Session Template configuration.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "iosxe_bgp_peer_session_template" "example" {
17+
asn = "65000"
18+
template_name = "PEER_SESSION_TEMPLATE_1"
19+
remote_as = "65001"
20+
description = "Peer Session Template Description"
21+
disable_connected_check = true
22+
ebgp_multihop = true
23+
ebgp_multihop_max_hop = 10
24+
update_source_interface_loopback = 100
25+
}
26+
```
27+
28+
<!-- schema generated by tfplugindocs -->
29+
## Schema
30+
31+
### Required
32+
33+
- `asn` (String)
34+
- `template_name` (String)
35+
36+
### Optional
37+
38+
- `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`.
39+
- Choices: `all`, `attributes`
40+
- `description` (String) Neighbor specific description
41+
- `device` (String) A device name from the provider configuration.
42+
- `disable_connected_check` (Boolean) one-hop away EBGP peer using loopback address
43+
- `ebgp_multihop` (Boolean) Allow EBGP neighbors not on directly connected networks. For single-hop ebgp peers, delete ebgp-multihop directly.
44+
- `ebgp_multihop_max_hop` (Number) - Range: `2`-`255`
45+
- `inherit_peer_session` (String) Inherit a peer-session template
46+
- `remote_as` (String) Specify a BGP neighbor remote-as
47+
- `update_source_interface_loopback` (Number) Loopback interface
48+
49+
### Read-Only
50+
51+
- `id` (String) The path of the object.
52+
53+
## Import
54+
55+
Import is supported using the following syntax:
56+
57+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
58+
59+
```shell
60+
terraform import iosxe_bgp_peer_session_template.example "<asn>,<template_name>"
61+
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "iosxe_bgp_peer_session_template" "example" {
2+
asn = "65000"
3+
template_name = "PEER_SESSION_TEMPLATE_1"
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import iosxe_bgp_peer_session_template.example "<asn>,<template_name>"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resource "iosxe_bgp_peer_session_template" "example" {
2+
asn = "65000"
3+
template_name = "PEER_SESSION_TEMPLATE_1"
4+
remote_as = "65001"
5+
description = "Peer Session Template Description"
6+
disable_connected_check = true
7+
ebgp_multihop = true
8+
ebgp_multihop_max_hop = 10
9+
update_source_interface_loopback = 100
10+
}

gen/definitions/bgp_neighbor.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ attributes:
9999
- yang_name: ebgp-multihop/max-hop
100100
example: 10
101101
exclude_test: true
102+
- yang_name: inherit/peer-session
103+
example: PEER_SESSION_TEMPLATE_1
104+
exclude_test: true
102105
test_prerequisites:
103106
- path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=65000
104107
attributes:
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: BGP Peer Session Template
3+
path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=%v/template/peer-session=%s
4+
doc_category: BGP
5+
skip_minimum_test: true
6+
attributes:
7+
- yang_name: id
8+
tf_name: asn
9+
example: 65000
10+
- yang_name: name
11+
yang_scope: peer-session
12+
tf_name: template_name
13+
example: PEER_SESSION_TEMPLATE_1
14+
- yang_name: remote-as
15+
example: 65001
16+
- yang_name: description
17+
example: Peer Session Template Description
18+
- yang_name: disable-connected-check
19+
example: true
20+
- yang_name: ebgp-multihop
21+
example: true
22+
- yang_name: ebgp-multihop/max-hop
23+
example: 10
24+
- yang_name: update-source/interface/interface-choice/Loopback/Loopback
25+
xpath: update-source/interface/Loopback
26+
tf_name: update_source_interface_loopback
27+
type: Int64
28+
example: 100
29+
- yang_name: inherit/peer-session
30+
example: PEER_SESSION_PARENT
31+
exclude_test: true
32+
test_prerequisites:
33+
- path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=65000
34+
attributes:
35+
- name: id
36+
value: 65000
37+
- path: Cisco-IOS-XE-native:native/interface/Loopback=100
38+
attributes:
39+
- name: name
40+
value: 100

internal/provider/data_source_iosxe_bgp_neighbor.go

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