Skip to content

Commit

Permalink
Add vpc keepalive resource (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomezve authored Dec 18, 2023
1 parent b4c5cc7 commit fb7bf44
Show file tree
Hide file tree
Showing 18 changed files with 1,096 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.2 (unreleased)

- Add `nxos_vpc_keepalive` resource and data source

## 0.5.1

- Add `nxos_bgp_advertised_prefix` resource and data source
Expand Down
45 changes: 45 additions & 0 deletions docs/data-sources/vpc_keepalive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_vpc_keepalive Data Source - terraform-provider-nxos"
subcategory: "vPC"
description: |-
This data source can read the vPC keepalive configuration.
API Documentation: vpcKeepalive https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Keepalive/
---

# nxos_vpc_keepalive (Data Source)

This data source can read the vPC keepalive configuration.

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

## Example Usage

```terraform
data "nxos_vpc_keepalive" "example" {
}
```

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

### Optional

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

### Read-Only

- `destination_ip` (String) vPC Keepalive destination address.
- `flush_timeout` (Number) vPC Keepalive flush timeout.
- `id` (String) The distinguished name of the object.
- `interval` (Number) vPC Keepalive interval.
- `precedence_type` (Number) vPC Keepalive precedence type. `0` - network, `1` - internet, `2` - critical, `3` flash-override, `4` - flash, `5` - immediate, `6` - prioriy, `7` - routine.
- `precedence_value` (Number) vPC Keepalive precedence value.
- `source_ip` (String) vPC Keepalive source address.
- `timeout` (Number) vPC Keepalive timeout.
- `type_of_service_byte` (Number) vPC Keepalive type of service (ToS) byte.
- `type_of_service_configuration_type` (Number) vPC Keepalive type of service (ToS) configuration type. `0` - noCfg, `1` - tos-byte, `2` - tos-value, `3` - tos-type, `4` - precedence-type, `5` - precedence-value.
- `type_of_service_type` (Number) vPC Keepalive type of service (ToS) type. `0` - min-delay, `1` - max-throughput, `2` - max-reliability, `3` - min-monetary-cost, `4` - normal.
- `type_of_service_value` (Number) vPC Keepalive type of service (ToS) value.
- `udp_port` (Number) vPC Keepalive UDP port.
- `vrf` (String) vPC Keepalive VRF.
1 change: 1 addition & 0 deletions docs/guides/supported_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ For the following DME objects a corresponding Terraform resource and data source
| [vpcDom](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/System/vpc:Dom/) | [nxos_vpc_domain](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_domain) | [nxos_vpc_domain](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/vpc_domain) |
| [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) |
| [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) |
Expand Down
3 changes: 2 additions & 1 deletion docs/resources/vpc_domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |-
Parent resources
nxosvpcinstance https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_instance
Child resources
nxosvpcinterface https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_interface
nxosvpcinterface https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_interfacenxosvpckeepalive https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vpc_keepalive
---

# nxos_vpc_domain (Resource)
Expand All @@ -24,6 +24,7 @@ This resource can manage the vPC domain configuration.
### Child resources

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

## Example Usage

Expand Down
85 changes: 85 additions & 0 deletions docs/resources/vpc_keepalive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_vpc_keepalive Resource - terraform-provider-nxos"
subcategory: "vPC"
description: |-
This resource can manage the vPC keepalive configuration.
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
---

# nxos_vpc_keepalive (Resource)

This resource can manage the vPC keepalive configuration.

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

### Parent resources

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

## Example Usage

```terraform
resource "nxos_vpc_keepalive" "example" {
destination_ip = "192.168.1.1"
flush_timeout = 3
interval = 1000
precedence_type = 0
precedence_value = 6
source_ip = "192.168.1.2"
timeout = 5
type_of_service_byte = 0
type_of_service_configuration_type = 0
type_of_service_type = 0
type_of_service_value = 0
udp_port = 1234
vrf = "management"
}
```

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

### Required

- `destination_ip` (String) vPC Keepalive destination address.
- `source_ip` (String) vPC Keepalive source address.

### Optional

- `device` (String) A device name from the provider configuration.
- `flush_timeout` (Number) vPC Keepalive flush timeout.
- Range: `3`-`10`
- `interval` (Number) vPC Keepalive interval.
- Range: `400`-`10000`
- `precedence_type` (Number) vPC Keepalive precedence type. `0` - network, `1` - internet, `2` - critical, `3` flash-override, `4` - flash, `5` - immediate, `6` - prioriy, `7` - routine.
- Range: `0`-`7`
- `precedence_value` (Number) vPC Keepalive precedence value.
- Range: `0`-`7`
- `timeout` (Number) vPC Keepalive timeout.
- Range: `3`-`20`
- `type_of_service_byte` (Number) vPC Keepalive type of service (ToS) byte.
- Range: `0`-`255`
- `type_of_service_configuration_type` (Number) vPC Keepalive type of service (ToS) configuration type. `0` - noCfg, `1` - tos-byte, `2` - tos-value, `3` - tos-type, `4` - precedence-type, `5` - precedence-value.
- Range: `0`-`5`
- `type_of_service_type` (Number) vPC Keepalive type of service (ToS) type. `0` - min-delay, `1` - max-throughput, `2` - max-reliability, `3` - min-monetary-cost, `4` - normal.
- Range: `0`-`4`
- `type_of_service_value` (Number) vPC Keepalive type of service (ToS) value.
- Range: `0`-`15`
- `udp_port` (Number) vPC Keepalive UDP port.
- Range: `1`-`65535`
- `vrf` (String) vPC Keepalive VRF.

### Read-Only

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

## Import

Import is supported using the following syntax:

```shell
terraform import nxos_vpc_keepalive.example "sys/vpc/inst/dom/keepalive"
```
2 changes: 2 additions & 0 deletions examples/data-sources/nxos_vpc_keepalive/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data "nxos_vpc_keepalive" "example" {
}
1 change: 1 addition & 0 deletions examples/resources/nxos_vpc_keepalive/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import nxos_vpc_keepalive.example "sys/vpc/inst/dom/keepalive"
15 changes: 15 additions & 0 deletions examples/resources/nxos_vpc_keepalive/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "nxos_vpc_keepalive" "example" {
destination_ip = "192.168.1.1"
flush_timeout = 3
interval = 1000
precedence_type = 0
precedence_value = 6
source_ip = "192.168.1.2"
timeout = 5
type_of_service_byte = 0
type_of_service_configuration_type = 0
type_of_service_type = 0
type_of_service_value = 0
udp_port = 1234
vrf = "management"
}
1 change: 1 addition & 0 deletions gen/definitions/vpc_domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parents:
- vPC Instance
children:
- vPC Interface
- vPC Keepalive
attributes:
- nxos_name: adminSt
tf_name: admin_state
Expand Down
121 changes: 121 additions & 0 deletions gen/definitions/vpc_keepalive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
name: vPC Keepalive
class_name: vpcKeepalive
dn: sys/vpc/inst/dom/keepalive
ds_description: This data source can read the vPC keepalive configuration.
res_description: This resource can manage the vPC keepalive configuration.
doc_path: System/vpc:Keepalive/
doc_category: vPC
parents:
- vPC Domain
attributes:
- nxos_name: destIp
tf_name: destination_ip
type: String
mandatory: true
description: "vPC Keepalive destination address."
example: "192.168.1.1"
- nxos_name: flushTout
tf_name: flush_timeout
type: Int64
description: "vPC Keepalive flush timeout."
min_int: 3
max_int: 10
default: 3
example: 3
- nxos_name: interval
tf_name: interval
type: Int64
description: "vPC Keepalive interval."
min_int: 400
max_int: 10000
default: 1000
example: 1000
- nxos_name: precType
tf_name: precedence_type
type: Int64
description: "vPC Keepalive precedence type. `0` - network, `1` - internet, `2` - critical, `3` flash-override, `4` - flash, `5` - immediate, `6` - prioriy, `7` - routine."
min_int: 0
max_int: 7
default: 0
example: 0
- nxos_name: precValue
tf_name: precedence_value
type: Int64
description: "vPC Keepalive precedence value."
min_int: 0
max_int: 7
default: 6
example: 6
- nxos_name: srcIp
tf_name: source_ip
type: String
mandatory: true
description: "vPC Keepalive source address."
example: "192.168.1.2"
- nxos_name: timeout
tf_name: timeout
type: Int64
description: "vPC Keepalive timeout."
min_int: 3
max_int: 20
default: 5
example: 5
- nxos_name: tosByte
tf_name: type_of_service_byte
type: Int64
description: "vPC Keepalive type of service (ToS) byte."
min_int: 0
max_int: 255
default: 0
example: 0
- nxos_name: tosCfgType
tf_name: type_of_service_configuration_type
type: Int64
description: "vPC Keepalive type of service (ToS) configuration type. `0` - noCfg, `1` - tos-byte, `2` - tos-value, `3` - tos-type, `4` - precedence-type, `5` - precedence-value."
min_int: 0
max_int: 5
default: 0
example: 0
- nxos_name: tosType
tf_name: type_of_service_type
type: Int64
description: "vPC Keepalive type of service (ToS) type. `0` - min-delay, `1` - max-throughput, `2` - max-reliability, `3` - min-monetary-cost, `4` - normal."
min_int: 0
max_int: 4
default: 4
example: 0
- nxos_name: tosValue
tf_name: type_of_service_value
type: Int64
description: "vPC Keepalive type of service (ToS) value."
min_int: 0
max_int: 15
default: 0
example: 0
- nxos_name: udpPort
tf_name: udp_port
type: Int64
description: "vPC Keepalive UDP port."
min_int: 1
max_int: 65535
example: 1234
omit_empty_value: true
- nxos_name: vrf
tf_name: vrf
description: "vPC Keepalive VRF."
type: String
example: "management"
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]
Loading

0 comments on commit fb7bf44

Please sign in to comment.