-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bgp advertised prefix resource and data source (#164)
- Loading branch information
Showing
20 changed files
with
893 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "nxos_bgp_advertised_prefix Data Source - terraform-provider-nxos" | ||
subcategory: "BGP" | ||
description: |- | ||
This data source can read the BGP (VRF) advertised prefix configuration. | ||
API Documentation: bgpAdvPrefix https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:AdvPrefix/ | ||
--- | ||
|
||
# nxos_bgp_advertised_prefix (Data Source) | ||
|
||
This data source can read the BGP (VRF) advertised prefix configuration. | ||
|
||
- API Documentation: [bgpAdvPrefix](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:AdvPrefix/) | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "nxos_bgp_advertised_prefix" "example" { | ||
asn = "65001" | ||
vrf = "default" | ||
address_family = "ipv4-ucast" | ||
prefix = "192.168.1.0/24" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `address_family` (String) Address Family. | ||
- `asn` (String) Autonomous system number. | ||
- `prefix` (String) IP address of the network or prefix to advertise. | ||
- `vrf` (String) VRF name. | ||
|
||
### Optional | ||
|
||
- `device` (String) A device name from the provider configuration. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The distinguished name of the object. | ||
- `route_map` (String) Route map to modify attributes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "nxos_bgp_advertised_prefix Resource - terraform-provider-nxos" | ||
subcategory: "BGP" | ||
description: |- | ||
This resource can manage the BGP (VRF) advertised prefix configuration. | ||
API Documentation: bgpAdvPrefix https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:AdvPrefix/ | ||
Parent resources | ||
nxosbgpaddress_family https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_address_family | ||
--- | ||
|
||
# nxos_bgp_advertised_prefix (Resource) | ||
|
||
This resource can manage the BGP (VRF) advertised prefix configuration. | ||
|
||
- API Documentation: [bgpAdvPrefix](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/bgp:AdvPrefix/) | ||
|
||
### Parent resources | ||
|
||
- [nxos_bgp_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/bgp_address_family) | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "nxos_bgp_advertised_prefix" "example" { | ||
asn = "65001" | ||
vrf = "default" | ||
address_family = "ipv4-ucast" | ||
prefix = "192.168.1.0/24" | ||
route_map = "rt-map" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `address_family` (String) Address Family. | ||
- Choices: `ipv4-ucast`, `ipv4-mcast`, `vpnv4-ucast`, `ipv6-ucast`, `ipv6-mcast`, `vpnv6-ucast`, `vpnv6-mcast`, `l2vpn-evpn`, `ipv4-lucast`, `ipv6-lucast`, `lnkstate`, `ipv4-mvpn`, `ipv6-mvpn`, `l2vpn-vpls`, `ipv4-mdt` | ||
- Default value: `ipv4-ucast` | ||
- `asn` (String) Autonomous system number. | ||
- `prefix` (String) IP address of the network or prefix to advertise. | ||
- `vrf` (String) VRF name. | ||
|
||
### Optional | ||
|
||
- `device` (String) A device name from the provider configuration. | ||
- `route_map` (String) Route map to modify attributes. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The distinguished name of the object. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import nxos_bgp_advertised_prefix.example "sys/bgp/inst/dom-[default]/af-[ipv4-ucast]/prefix-[192.168.1.0/24]" | ||
``` |
6 changes: 6 additions & 0 deletions
6
examples/data-sources/nxos_bgp_advertised_prefix/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
data "nxos_bgp_advertised_prefix" "example" { | ||
asn = "65001" | ||
vrf = "default" | ||
address_family = "ipv4-ucast" | ||
prefix = "192.168.1.0/24" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import nxos_bgp_advertised_prefix.example "sys/bgp/inst/dom-[default]/af-[ipv4-ucast]/prefix-[192.168.1.0/24]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
resource "nxos_bgp_advertised_prefix" "example" { | ||
asn = "65001" | ||
vrf = "default" | ||
address_family = "ipv4-ucast" | ||
prefix = "192.168.1.0/24" | ||
route_map = "rt-map" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
name: BGP Advertised Prefix | ||
class_name: bgpAdvPrefix | ||
dn: sys/bgp/inst/dom-[%s]/af-[%s]/prefix-[%s] | ||
ds_description: This data source can read the BGP (VRF) advertised prefix configuration. | ||
res_description: This resource can manage the BGP (VRF) advertised prefix configuration. | ||
doc_path: Routing%20and%20Forwarding/bgp:AdvPrefix/ | ||
doc_category: BGP | ||
parents: | ||
- BGP Address Family | ||
attributes: | ||
- nxos_name: asn | ||
tf_name: asn | ||
type: String | ||
reference_only: true | ||
description: 'Autonomous system number.' | ||
example: '65001' | ||
- nxos_name: name | ||
tf_name: vrf | ||
type: String | ||
id: true | ||
reference_only: true | ||
description: 'VRF name.' | ||
example: default | ||
- nxos_name: type | ||
tf_name: address_family | ||
type: String | ||
id: true | ||
reference_only: true | ||
description: 'Address Family.' | ||
enum_values: | ||
- ipv4-ucast | ||
- ipv4-mcast | ||
- vpnv4-ucast | ||
- ipv6-ucast | ||
- ipv6-mcast | ||
- vpnv6-ucast | ||
- vpnv6-mcast | ||
- l2vpn-evpn | ||
- ipv4-lucast | ||
- ipv6-lucast | ||
- lnkstate | ||
- ipv4-mvpn | ||
- ipv6-mvpn | ||
- l2vpn-vpls | ||
- ipv4-mdt | ||
default_value: 'ipv4-ucast' | ||
example: 'ipv4-ucast' | ||
- nxos_name: addr | ||
tf_name: prefix | ||
type: String | ||
id: true | ||
description: 'IP address of the network or prefix to advertise.' | ||
example: '192.168.1.0/24' | ||
- nxos_name: rtMap | ||
tf_name: route_map | ||
type: String | ||
description: 'Route map to modify attributes.' | ||
default_value: '' | ||
example: rt-map | ||
test_prerequisites: | ||
- dn: sys/fm/bgp | ||
class_name: fmBgp | ||
no_delete: true | ||
attributes: | ||
- name: adminSt | ||
value: enabled | ||
- dn: sys/bgp | ||
class_name: bgpEntity | ||
dependencies: [0] | ||
- dn: sys/bgp/inst | ||
class_name: bgpInst | ||
attributes: | ||
- name: adminSt | ||
value: enabled | ||
- name: asn | ||
value: '65001' | ||
dependencies: [1] | ||
- dn: sys/bgp/inst/dom-[default] | ||
class_name: bgpDom | ||
attributes: | ||
- name: name | ||
value: default | ||
dependencies: [2] | ||
- dn: sys/bgp/inst/dom-[default]/af-[ipv4-ucast] | ||
class_name: bgpDomAf | ||
attributes: | ||
- name: name | ||
value: default | ||
- name: type | ||
value: ipv4cast | ||
dependencies: [2] |
124 changes: 124 additions & 0 deletions
124
internal/provider/data_source_nxos_bgp_advertised_prefix.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.