Skip to content

Commit

Permalink
Add attributes to bgp resources (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
summed authored Mar 21, 2024
1 parent a41f835 commit c598b3f
Show file tree
Hide file tree
Showing 18 changed files with 627 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/data-sources/router_bgp_neighbor_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ data "iosxr_router_bgp_neighbor_address_family" "example" {
### Read-Only

- `advertise_vpnv4_unicast_enable_re_originated_stitching_rt` (Boolean) Advertise re-originated and local routes with stitching Route-Targets
- `default_originate_inheritance_disable` (Boolean) Prevent default-originate being inherited from a parent group
- `default_originate_route_policy` (String) Route policy to specify criteria to originate default
- `encapsulation_type_srv6` (Boolean) SRv6 encapsulation
- `id` (String) The path of the retrieved object.
- `import_stitching_rt_re_originate_stitching_rt` (Boolean) Reoriginate imported routes by attaching stitching RTs
- `maximum_prefix_discard_extra_paths` (Boolean) Discard extra paths when limit is exceeded
- `maximum_prefix_limit` (Number) Maximum number of prefixes to accept from this peer
- `maximum_prefix_restart` (Number) Restart time interval
- `maximum_prefix_threshold` (Number) Threshold value (%) at which to generate a warning msg
- `maximum_prefix_warning_only` (Boolean) Only give warning message when limit is exceeded
- `next_hop_self` (Boolean) Disable the next hop calculation for this neighbor
- `next_hop_self_inheritance_disable` (Boolean) Prevent next-hop-self from being inherited from the parent
- `route_policy_in` (String) Apply route policy to inbound routes
- `route_policy_out` (String) Apply route policy to outbound routes
- `route_reflector_client` (Boolean) Configure a neighbor as Route Reflector client
- `route_reflector_client_inheritance_disable` (Boolean) Prevent route-reflector-client from being inherited from the parent
- `send_community_ebgp` (Boolean) Send community attribute to this external neighbor
- `send_community_ebgp_inheritance_disable` (Boolean) Prevent send-community-ebgp from being inherited from the parent
- `soft_reconfiguration_inbound_always` (Boolean) Always use soft reconfig, even if route refresh is supported
3 changes: 3 additions & 0 deletions docs/data-sources/router_bgp_neighbor_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ data "iosxr_router_bgp_neighbor_group" "example" {
- `bfd_multiplier` (Number) Detect multiplier
- `id` (String) The path of the retrieved object.
- `remote_as` (String) bgp as-number
- `timers_holdtime` (String) Holdtime. Set 0 to disable keepalives/hold time.
- `timers_keepalive_interval` (Number) BGP timers
- `timers_minimum_acceptable_holdtime` (String) Minimum acceptable holdtime from neighbor. Set 0 to disable keepalives/hold time.
- `update_source` (String) Source of routing updates

<a id="nestedatt--address_families"></a>
Expand Down
25 changes: 25 additions & 0 deletions docs/resources/router_bgp_neighbor_address_family.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,21 @@ resource "iosxr_router_bgp_neighbor_address_family" "example" {
route_reflector_client = true
route_reflector_client_inheritance_disable = true
advertise_vpnv4_unicast_enable_re_originated_stitching_rt = true
next_hop_self = true
next_hop_self_inheritance_disable = true
encapsulation_type_srv6 = true
route_policy_in = "ROUTE_POLICY_1"
route_policy_out = "ROUTE_POLICY_1"
soft_reconfiguration_inbound_always = true
send_community_ebgp = true
send_community_ebgp_inheritance_disable = true
maximum_prefix_limit = 1248576
maximum_prefix_threshold = 80
maximum_prefix_restart = 5
maximum_prefix_discard_extra_paths = true
maximum_prefix_warning_only = true
default_originate_route_policy = "ROUTE_POLICY_1"
default_originate_inheritance_disable = true
}
```

Expand All @@ -36,21 +47,35 @@ resource "iosxr_router_bgp_neighbor_address_family" "example" {
- `af_name` (String) Enter Address Family command mode
- Choices: `all-address-family`, `ipv4-flowspec`, `ipv4-labeled-unicast`, `ipv4-mdt`, `ipv4-multicast`, `ipv4-mvpn`, `ipv4-rt-filter`, `ipv4-sr-policy`, `ipv4-tunnel`, `ipv4-unicast`, `ipv6-flowspec`, `ipv6-labeled-unicast`, `ipv6-multicast`, `ipv6-mvpn`, `ipv6-sr-policy`, `ipv6-unicast`, `l2vpn-evpn`, `l2vpn-mspw`, `l2vpn-vpls-vpws`, `link-state-link-state`, `vpnv4-flowspec`, `vpnv4-multicast`, `vpnv4-unicast`, `vpnv6-flowspec`, `vpnv6-multicast`, `vpnv6-unicast`
- `as_number` (String) bgp as-number
- `maximum_prefix_limit` (Number) Maximum number of prefixes to accept from this peer
- Range: `1`-`4294967295`
- `maximum_prefix_threshold` (Number) Threshold value (%) at which to generate a warning msg
- Range: `1`-`100`
- `neighbor_address` (String) Neighbor address

### Optional

- `advertise_vpnv4_unicast_enable_re_originated_stitching_rt` (Boolean) Advertise re-originated and local routes with stitching Route-Targets
- `default_originate_inheritance_disable` (Boolean) Prevent default-originate being inherited from a parent group
- `default_originate_route_policy` (String) Route policy to specify criteria to originate default
- `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_type_srv6` (Boolean) SRv6 encapsulation
- `import_stitching_rt_re_originate_stitching_rt` (Boolean) Reoriginate imported routes by attaching stitching RTs
- `maximum_prefix_discard_extra_paths` (Boolean) Discard extra paths when limit is exceeded
- `maximum_prefix_restart` (Number) Restart time interval
- Range: `1`-`65535`
- `maximum_prefix_warning_only` (Boolean) Only give warning message when limit is exceeded
- `next_hop_self` (Boolean) Disable the next hop calculation for this neighbor
- `next_hop_self_inheritance_disable` (Boolean) Prevent next-hop-self from being inherited from the parent
- `route_policy_in` (String) Apply route policy to inbound routes
- `route_policy_out` (String) Apply route policy to outbound routes
- `route_reflector_client` (Boolean) Configure a neighbor as Route Reflector client
- `route_reflector_client_inheritance_disable` (Boolean) Prevent route-reflector-client from being inherited from the parent
- `send_community_ebgp` (Boolean) Send community attribute to this external neighbor
- `send_community_ebgp_inheritance_disable` (Boolean) Prevent send-community-ebgp from being inherited from the parent
- `soft_reconfiguration_inbound_always` (Boolean) Always use soft reconfig, even if route refresh is supported

### Read-Only

Expand Down
7 changes: 7 additions & 0 deletions docs/resources/router_bgp_neighbor_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ resource "iosxr_router_bgp_neighbor_group" "example" {
route_policy_out = "ROUTE_POLICY_1"
}
]
timers_keepalive_interval = 5
timers_holdtime = "3"
timers_minimum_acceptable_holdtime = "3"
}
```

Expand All @@ -45,6 +48,9 @@ resource "iosxr_router_bgp_neighbor_group" "example" {

- `as_number` (String) bgp as-number
- `name` (String) Specify a Neighbor-group
- `timers_holdtime` (String) Holdtime. Set 0 to disable keepalives/hold time.
- `timers_keepalive_interval` (Number) BGP timers
- Range: `0`-`65535`

### Optional

Expand All @@ -66,6 +72,7 @@ resource "iosxr_router_bgp_neighbor_group" "example" {
- Choices: `all`, `attributes`
- `device` (String) A device name from the provider configuration.
- `remote_as` (String) bgp as-number
- `timers_minimum_acceptable_holdtime` (String) Minimum acceptable holdtime from neighbor. Set 0 to disable keepalives/hold time.
- `update_source` (String) Source of routing updates

### Read-Only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@ resource "iosxr_router_bgp_neighbor_address_family" "example" {
route_reflector_client = true
route_reflector_client_inheritance_disable = true
advertise_vpnv4_unicast_enable_re_originated_stitching_rt = true
next_hop_self = true
next_hop_self_inheritance_disable = true
encapsulation_type_srv6 = true
route_policy_in = "ROUTE_POLICY_1"
route_policy_out = "ROUTE_POLICY_1"
soft_reconfiguration_inbound_always = true
send_community_ebgp = true
send_community_ebgp_inheritance_disable = true
maximum_prefix_limit = 1248576
maximum_prefix_threshold = 80
maximum_prefix_restart = 5
maximum_prefix_discard_extra_paths = true
maximum_prefix_warning_only = true
default_originate_route_policy = "ROUTE_POLICY_1"
default_originate_inheritance_disable = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ resource "iosxr_router_bgp_neighbor_group" "example" {
route_policy_out = "ROUTE_POLICY_1"
}
]
timers_keepalive_interval = 5
timers_holdtime = "3"
timers_minimum_acceptable_holdtime = "3"
}
25 changes: 25 additions & 0 deletions gen/definitions/router_bgp_neighbor_address_family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ attributes:
example: true
- yang_name: advertise/vpnv4/unicast/enable/re-originated/stitching-rt
example: true
- yang_name: next-hop-self
example: true
- yang_name: next-hop-self/inheritance-disable
example: true
- yang_name: encapsulation-type/srv6
Expand All @@ -25,6 +27,29 @@ attributes:
example: ROUTE_POLICY_1
- yang_name: route-policy/out
example: ROUTE_POLICY_1
- yang_name: soft-reconfiguration/inbound/always
example: true
- yang_name: send-community-ebgp
example: true
- yang_name: send-community-ebgp/inheritance-disable
example: true
- yang_name: maximum-prefix/prefix-limit
tf_name: maximum_prefix_limit
optional: true
example: 1248576
- yang_name: maximum-prefix/threshold
optional: true
example: 80
- yang_name: maximum-prefix/restart
example: 5
- yang_name: maximum-prefix/discard-extra-paths
example: true
- yang_name: maximum-prefix/warning-only
example: true
- yang_name: default-originate/route-policy
example: ROUTE_POLICY_1
- yang_name: default-originate/inheritance-disable
example: true

test_prerequisites:
- path: Cisco-IOS-XR-um-router-bgp-cfg:/router/bgp/as[as-number=65001]
Expand Down
11 changes: 10 additions & 1 deletion gen/definitions/router_bgp_neighbor_group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ attributes:
example: ROUTE_POLICY_1
- yang_name: route-policy/out
example: ROUTE_POLICY_1
- yang_name: timers/keepalive-interval
optional: true
example: 5
- yang_name: timers/holdtime
optional: true
example: 3
- yang_name: timers/minimum-acceptable-holdtime
example: 3

test_prerequisites:
- path: Cisco-IOS-XR-um-router-bgp-cfg:/router/bgp/as[as-number=65001]
attributes:
Expand All @@ -68,4 +77,4 @@ test_prerequisites:
- name: route-policy-name
value: ROUTE_POLICY_1
- name: rpl-route-policy
value: "route-policy ROUTE_POLICY_1\\n pass\\nend-policy\\n"
value: "route-policy ROUTE_POLICY_1\\n pass\\nend-policy\\n"

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.

12 changes: 12 additions & 0 deletions internal/provider/data_source_iosxr_router_bgp_neighbor_group.go

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

Loading

0 comments on commit c598b3f

Please sign in to comment.