Skip to content

Commit

Permalink
Add vpc peerlink resource (#196)
Browse files Browse the repository at this point in the history
jgomezve authored Dec 18, 2023
1 parent fb7bf44 commit cb1cb2a
Showing 20 changed files with 732 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.5.2 (unreleased)

- Add `nxos_vpc_keepalive` resource and data source
- Add `nxos_vpc_peerlink` resource and data source

## 0.5.1

33 changes: 33 additions & 0 deletions docs/data-sources/vpc_peerlink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_vpc_peerlink Data Source - terraform-provider-nxos"
subcategory: "vPC"
description: |-
This data source can read the vPC peerlink configuration.
API Documentation: vpcPeerLink https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:PeerLink/
---

# nxos_vpc_peerlink (Data Source)

This data source can read the vPC peerlink configuration.

- API Documentation: [vpcPeerLink](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:PeerLink/)

## Example Usage

```terraform
data "nxos_vpc_peerlink" "example" {
}
```

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

### Optional

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

### Read-Only

- `id` (String) The distinguished name of the object.
- `port_channel_id` (String) vPC Peerlink port-channel id.
5 changes: 5 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,11 @@ description: |-

# Changelog

## 0.5.2 (unreleased)

- Add `nxos_vpc_keepalive` resource and data source
- Add `nxos_vpc_peerlink` resource and data source

## 0.5.1

- Add `nxos_bgp_advertised_prefix` resource and data source
1 change: 1 addition & 0 deletions docs/guides/supported_objects.md
Original file line number Diff line number Diff line change
@@ -133,6 +133,7 @@ For the following DME objects a corresponding Terraform resource and data source
| [vpcInst](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Inst/) | [nxos_vpc_instance](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_instance) | [nxos_vpc_instance](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_instance) |
| [vpcIf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:If/) | [nxos_vpc_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_interface) | [nxos_vpc_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_interface) |
| [vpcKeepalive](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Keepalive/) | [nxos_vpc_keepalive](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_keepalive) | [nxos_vpc_keepalive](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_keepalive) |
| [vpcPeerLink](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:PeerLink/) | [nxos_vpc_peerlink](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_peerlink) | [nxos_vpc_peerlink](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_peerlink) |
| [l3Inst](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%203/l3:Inst/) | [nxos_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf) | [nxos_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vrf) |
| [rtctrlDomAf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/rtctrl:DomAf/) | [nxos_vrf_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf_address_family) | [nxos_vrf_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vrf_address_family) |
| [rtctrlRttEntry](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/rtctrl:RttEntry/) | [nxos_vrf_route_target](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf_route_target) | [nxos_vrf_route_target](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vrf_route_target) |
6 changes: 6 additions & 0 deletions docs/resources/vpc_keepalive.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ description: |-
API Documentation: vpcKeepalive https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Keepalive/
Parent resources
nxosvpcdomain https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_domain
Child resources
nxosvpcpeerlink https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_peerlink
---

# nxos_vpc_keepalive (Resource)
@@ -19,6 +21,10 @@ This resource can manage the vPC keepalive configuration.

- [nxos_vpc_domain](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_domain)

### Child resources

- [nxos_vpc_peerlink](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_peerlink)

## Example Usage

```terraform
51 changes: 51 additions & 0 deletions docs/resources/vpc_peerlink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_vpc_peerlink Resource - terraform-provider-nxos"
subcategory: "vPC"
description: |-
This resource can manage the vPC peerlink configuration.
API Documentation: vpcPeerLink https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:PeerLink/
Parent resources
nxosvpckeepalive https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_keepalive
---

# nxos_vpc_peerlink (Resource)

This resource can manage the vPC peerlink configuration.

- API Documentation: [vpcPeerLink](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:PeerLink/)

### Parent resources

- [nxos_vpc_keepalive](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_keepalive)

## Example Usage

```terraform
resource "nxos_vpc_peerlink" "example" {
port_channel_id = "po1"
}
```

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

### Required

- `port_channel_id` (String) vPC Peerlink port-channel id.

### Optional

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

### Read-Only

- `id` (String) The distinguished name of the object.

## Import

Import is supported using the following syntax:

```shell
terraform import nxos_vpc_peerlink.example "sys/vpc/inst/dom/keepalive/peerlink"
```
2 changes: 2 additions & 0 deletions examples/data-sources/nxos_vpc_peerlink/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data "nxos_vpc_peerlink" "example" {
}
1 change: 1 addition & 0 deletions examples/resources/nxos_vpc_peerlink/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import nxos_vpc_peerlink.example "sys/vpc/inst/dom/keepalive/peerlink"
3 changes: 3 additions & 0 deletions examples/resources/nxos_vpc_peerlink/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "nxos_vpc_peerlink" "example" {
port_channel_id = "po1"
}
4 changes: 3 additions & 1 deletion gen/definitions/vpc_keepalive.yaml
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ doc_path: System/vpc:Keepalive/
doc_category: vPC
parents:
- vPC Domain
children:
- vPC Peerlink
attributes:
- nxos_name: destIp
tf_name: destination_ip
@@ -118,4 +120,4 @@ test_prerequisites:
dependencies: [0]
- dn: sys/vpc/inst/dom
class_name: vpcDom
dependencies: [1]
dependencies: [1]
43 changes: 43 additions & 0 deletions gen/definitions/vpc_peerlink.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: vPC Peerlink
class_name: vpcPeerLink
dn: sys/vpc/inst/dom/keepalive/peerlink
ds_description: This data source can read the vPC peerlink configuration.
res_description: This resource can manage the vPC peerlink configuration.
doc_path: System/vpc:PeerLink/
doc_category: vPC
parents:
- vPC Keepalive
attributes:
- nxos_name: id
tf_name: port_channel_id
type: String
mandatory: true
description: "vPC Peerlink port-channel id."
example: "po1"
test_prerequisites:
- dn: sys/fm/vpc
class_name: fmVpc
no_delete: true
attributes:
- name: adminSt
value: enabled
- dn: sys/vpc/inst
class_name: vpcInst
dependencies: [0]
- dn: sys/vpc/inst/dom
class_name: vpcDom
dependencies: [1]
- dn: sys/vpc/inst/dom/keepalive
class_name: vpcKeepalive
dependencies: [2]
- dn: sys/fm/lacp
class_name: fmLacp
no_delete: true
attributes:
- adminSt: enabled
- dn: sys/intf/aggr-[123]
class_name: pcAggrIf
dependencies: [4]
attributes:
- id: po1
108 changes: 108 additions & 0 deletions internal/provider/data_source_nxos_vpc_peerlink.go

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

100 changes: 100 additions & 0 deletions internal/provider/data_source_nxos_vpc_peerlink_test.go
59 changes: 59 additions & 0 deletions internal/provider/model_nxos_vpc_peerlink.go
2 changes: 2 additions & 0 deletions internal/provider/provider.go
2 changes: 1 addition & 1 deletion internal/provider/resource_nxos_vpc_keepalive.go
196 changes: 196 additions & 0 deletions internal/provider/resource_nxos_vpc_peerlink.go
111 changes: 111 additions & 0 deletions internal/provider/resource_nxos_vpc_peerlink_test.go
5 changes: 5 additions & 0 deletions templates/guides/changelog.md.tmpl
Original file line number Diff line number Diff line change
@@ -7,6 +7,11 @@ description: |-

# Changelog

## 0.5.2 (unreleased)

- Add `nxos_vpc_keepalive` resource and data source
- Add `nxos_vpc_peerlink` resource and data source

## 0.5.1

- Add `nxos_bgp_advertised_prefix` resource and data source
1 change: 1 addition & 0 deletions templates/guides/supported_objects.md.tmpl
Original file line number Diff line number Diff line change
@@ -133,6 +133,7 @@ For the following DME objects a corresponding Terraform resource and data source
| [vpcInst](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Inst/) | [nxos_vpc_instance](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_instance) | [nxos_vpc_instance](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_instance) |
| [vpcIf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:If/) | [nxos_vpc_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_interface) | [nxos_vpc_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_interface) |
| [vpcKeepalive](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Keepalive/) | [nxos_vpc_keepalive](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_keepalive) | [nxos_vpc_keepalive](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_keepalive) |
| [vpcPeerLink](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:PeerLink/) | [nxos_vpc_peerlink](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_peerlink) | [nxos_vpc_peerlink](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_peerlink) |
| [l3Inst](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%203/l3:Inst/) | [nxos_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf) | [nxos_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vrf) |
| [rtctrlDomAf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/rtctrl:DomAf/) | [nxos_vrf_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf_address_family) | [nxos_vrf_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vrf_address_family) |
| [rtctrlRttEntry](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/rtctrl:RttEntry/) | [nxos_vrf_route_target](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf_route_target) | [nxos_vrf_route_target](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vrf_route_target) |

0 comments on commit cb1cb2a

Please sign in to comment.