Skip to content

Commit

Permalink
Fix bgp ospf controls (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
moskrive authored Jun 23, 2024
1 parent b053e52 commit dca17a3
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 70 deletions.
4 changes: 3 additions & 1 deletion docs/data-sources/bgp_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ data "nxos_bgp_peer" "example" {
- `keepalive` (Number) BGP Keepalive Timer in seconds
- `password` (String) Password.
- `password_type` (String) Password Encryption Type.
- `peer_control` (String) Peer Controls.
- `peer_control` (String) Peer Controls. Choices: `bfd`, `dis-conn-check`, `cap-neg-off`, `no-dyn-cap`. Can be an empty string. Allowed formats:
- Single value. Example: `bfd`
- Multiple values (comma-separated). Example: `bfd,dis-conn-check`. In this case values must be in alphabetical order.
- `peer_template` (String) Peer template name.
- `peer_type` (String) Neighbor Fabric Type.
- `remote_asn` (String) Peer autonomous system number.
Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/ospf_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ data "nxos_ospf_vrf" "example" {
- `admin_state` (String) Administrative state.
- `bandwidth_reference` (Number) Bandwidth reference value.
- `bandwidth_reference_unit` (String) Bandwidth reference unit.
- `control` (String) Controls.
- `control` (String) Controls. Choices: `unspecified`, `bfd`, `name-lookup`, `default-passive`, `segrt`. Can be an empty string. Allowed formats:
- Single value. Example: `bfd`
- Multiple values (comma-separated). Example: `bfd,default-passive`. In this case values must be in alphabetical order.
- `distance` (Number) Administrative distance preference.
- `id` (String) The distinguished name of the object.
- `router_id` (String) Router ID.
7 changes: 4 additions & 3 deletions docs/resources/bgp_peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "nxos_bgp_peer" "example" {
hold_time = 45
keepalive = 15
ebgp_multihop_ttl = 5
peer_control = "bfd"
peer_control = "bfd,dis-conn-check"
password_type = "LINE"
password = "secret_password"
}
Expand Down Expand Up @@ -77,8 +77,9 @@ resource "nxos_bgp_peer" "example" {
- `password` (String) Password.
- `password_type` (String) Password Encryption Type.
- Choices: `0`, `3`, `LINE`, `7`
- `peer_control` (String) Peer Controls.
- Choices: `bfd`, `dis-conn-check`, `cap-neg-off`, `no-dyn-cap`
- `peer_control` (String) Peer Controls. Choices: `bfd`, `dis-conn-check`, `cap-neg-off`, `no-dyn-cap`. Can be an empty string. Allowed formats:
- Single value. Example: `bfd`
- Multiple values (comma-separated). Example: `bfd,dis-conn-check`. In this case values must be in alphabetical order.
- `peer_template` (String) Peer template name.
- `peer_type` (String) Neighbor Fabric Type.
- Choices: `fabric-internal`, `fabric-external`, `fabric-border-leaf`
Expand Down
8 changes: 5 additions & 3 deletions docs/resources/ospf_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource "nxos_ospf_vrf" "example" {
bandwidth_reference_unit = "mbps"
distance = 110
router_id = "34.56.78.90"
control = "bfd"
control = "bfd,default-passive"
}
```

Expand All @@ -66,8 +66,10 @@ resource "nxos_ospf_vrf" "example" {
- `bandwidth_reference_unit` (String) Bandwidth reference unit.
- Choices: `mbps`, `gbps`
- Default value: `mbps`
- `control` (String) Controls.
- Choices: `unspecified`, `bfd`, `name-lookup`, `default-passive`, `segrt`
- `control` (String) Controls. Choices: `unspecified`, `bfd`, `name-lookup`, `default-passive`, `segrt`. Can be an empty string. Allowed formats:
- Single value. Example: `bfd`
- Multiple values (comma-separated). Example: `bfd,default-passive`. In this case values must be in alphabetical order.
- Default value: `unspecified`
- `device` (String) A device name from the provider configuration.
- `distance` (Number) Administrative distance preference.
- Range: `1`-`255`
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/nxos_bgp_peer/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "nxos_bgp_peer" "example" {
hold_time = 45
keepalive = 15
ebgp_multihop_ttl = 5
peer_control = "bfd"
peer_control = "bfd,dis-conn-check"
password_type = "LINE"
password = "secret_password"
}
2 changes: 1 addition & 1 deletion examples/resources/nxos_ospf_vrf/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ resource "nxos_ospf_vrf" "example" {
bandwidth_reference_unit = "mbps"
distance = 110
router_id = "34.56.78.90"
control = "bfd"
control = "bfd,default-passive"
}
22 changes: 12 additions & 10 deletions gen/definitions/bgp_peer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,8 @@ attributes:
- nxos_name: ctrl
tf_name: peer_control
type: String
description: "Peer Controls."
enum_values:
- bfd
- dis-conn-check
- cap-neg-off
- no-dyn-cap
example: bfd
description: 'Peer Controls. Choices: `bfd`, `dis-conn-check`, `cap-neg-off`, `no-dyn-cap`. Can be an empty string. Allowed formats:\n - Single value. Example: `bfd`\n - Multiple values (comma-separated). Example: `bfd,dis-conn-check`. In this case values must be in alphabetical order.'
example: 'bfd,dis-conn-check'
- nxos_name: passwdType
tf_name: password_type
type: String
Expand All @@ -123,20 +118,27 @@ test_prerequisites:
attributes:
- name: adminSt
value: enabled
- dn: sys/fm/bfd
class_name: fmBfd
dependencies: [0]
no_delete: true
attributes:
- name: adminSt
value: enabled
- dn: sys/bgp
class_name: bgpEntity
dependencies: [0]
dependencies: [1]
- dn: sys/bgp/inst
class_name: bgpInst
attributes:
- name: adminSt
value: enabled
- name: asn
value: "65001"
dependencies: [1]
dependencies: [2]
- dn: sys/bgp/inst/dom-[default]
class_name: bgpDom
attributes:
- name: name
value: default
dependencies: [2]
dependencies: [3]
21 changes: 11 additions & 10 deletions gen/definitions/ospf_vrf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,28 @@ attributes:
- nxos_name: ctrl
tf_name: control
type: String
description: "Controls."
enum_values:
- unspecified
- bfd
- name-lookup
- default-passive
- segrt
example: bfd
description: 'Controls. Choices: `unspecified`, `bfd`, `name-lookup`, `default-passive`, `segrt`. Can be an empty string. Allowed formats:\n - Single value. Example: `bfd`\n - Multiple values (comma-separated). Example: `bfd,default-passive`. In this case values must be in alphabetical order.'
example: 'bfd,default-passive'
test_prerequisites:
- dn: sys/fm/ospf
class_name: fmOspf
no_delete: true
attributes:
- name: adminSt
value: enabled
- dn: sys/fm/bfd
class_name: fmBfd
dependencies: [0]
no_delete: true
attributes:
- name: adminSt
value: enabled
- dn: sys/ospf
class_name: ospfEntity
dependencies: [0]
dependencies: [1]
- dn: sys/ospf/inst-[OSPF1]
class_name: ospfInst
attributes:
- name: name
value: OSPF1
dependencies: [1]
dependencies: [2]
2 changes: 1 addition & 1 deletion internal/provider/data_source_nxos_bgp_peer.go

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

26 changes: 18 additions & 8 deletions internal/provider/data_source_nxos_bgp_peer_test.go

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

2 changes: 1 addition & 1 deletion internal/provider/data_source_nxos_ospf_vrf.go

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

22 changes: 16 additions & 6 deletions internal/provider/data_source_nxos_ospf_vrf_test.go

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

5 changes: 1 addition & 4 deletions internal/provider/resource_nxos_bgp_peer.go

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

28 changes: 19 additions & 9 deletions internal/provider/resource_nxos_bgp_peer_test.go

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

Loading

0 comments on commit dca17a3

Please sign in to comment.