Skip to content

Commit

Permalink
Add isis af and overload resources and data sources (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmuller authored Feb 27, 2025
1 parent dabde0b commit 71be584
Show file tree
Hide file tree
Showing 31 changed files with 1,862 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Check if a device referenced in a resource or data source exists in the provider configuration
- When importing a resource, also populate attributes referencing parent resources
- Add `nxos_isis_address_family` resource and data source
- Add `nxos_isis_overload` resource and data source

## 0.5.7

Expand Down
45 changes: 45 additions & 0 deletions docs/data-sources/isis_address_family.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_isis_address_family Data Source - terraform-provider-nxos"
subcategory: "ISIS"
description: |-
This data source can read the IS-IS Address Family configuration.
API Documentation: isisDomAf https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:DomAf/
---

# nxos_isis_address_family (Data Source)

This data source can read the IS-IS Address Family configuration.

- API Documentation: [isisDomAf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:DomAf/)

## Example Usage

```terraform
data "nxos_isis_address_family" "example" {
instance_name = "ISIS1"
vrf = "default"
address_family = "v4"
}
```

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

### Required

- `address_family` (String) Address family type.
- `instance_name` (String) IS-IS instance name.
- `vrf` (String) VRF name.

### Optional

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

### Read-Only

- `enable_bfd` (Boolean) Enabling BFD on all ISIS domain interfaces.
- `id` (String) The distinguished name of the object.
- `prefix_advertise_passive_l1` (Boolean) Prefix advertise passive only for level-1
- `prefix_advertise_passive_l2` (Boolean) Prefix advertise passive only level-2
- `segment_routing_mpls` (Boolean) Segment routing for MPLS
40 changes: 40 additions & 0 deletions docs/data-sources/isis_overload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_isis_overload Data Source - terraform-provider-nxos"
subcategory: "ISIS"
description: |-
This data source can read the IS-IS overload configuration.
API Documentation: isisOverload https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Overload/
---

# nxos_isis_overload (Data Source)

This data source can read the IS-IS overload configuration.

- API Documentation: [isisOverload](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Overload/)

## Example Usage

```terraform
data "nxos_isis_overload" "example" {
instance_name = "ISIS1"
vrf = "default"
}
```

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

### Required

- `instance_name` (String) IS-IS instance name.
- `vrf` (String) VRF name.

### Optional

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

### Read-Only

- `id` (String) The distinguished name of the object.
- `startup_time` (Number) The overload startup time. The overload state begins when the switch boots up and ends at the time specified as the overload startup time.
2 changes: 2 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ description: |-

- Check if a device referenced in a resource or data source exists in the provider configuration
- When importing a resource, also populate attributes referencing parent resources
- Add `nxos_isis_address_family` resource and data source
- Add `nxos_isis_overload` resource and data source

## 0.5.7

Expand Down
2 changes: 2 additions & 0 deletions docs/guides/supported_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ For the following DME objects a corresponding Terraform resource and data source
| [ipv4Route](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%203/ipv4:Route/) | [nxos_ipv4_static_route](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/ipv4_static_route) | [nxos_ipv4_static_route](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/ipv4_static_route) |
| [ipv4Dom](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%203/ipv4:Dom/) | [nxos_ipv4_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/ipv4_vrf) | [nxos_ipv4_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/ipv4_vrf) |
| [isisEntity](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Entity/) | [nxos_isis](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis) | [nxos_isis](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/isis) |
| [isisDomAf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:DomAf/) | [nxos_isis_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_address_family) | [nxos_isis_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/isis_address_family) |
| [isisInst](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Inst/) | [nxos_isis_instance](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_instance) | [nxos_isis_instance](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/isis_instance) |
| [isisInternalIf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:InternalIf/) | [nxos_isis_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_interface) | [nxos_isis_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/isis_interface) |
| [isisOverload](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Overload/) | [nxos_isis_overload](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_overload) | [nxos_isis_overload](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/isis_overload) |
| [isisDom](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Dom/) | [nxos_isis_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_vrf) | [nxos_isis_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/isis_vrf) |
| [l3LbRtdIf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Layer%203/l3:LbRtdIf/) | [nxos_loopback_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/loopback_interface) | [nxos_loopback_interface](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/loopback_interface) |
| [nwRtVrfMbr](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/nw:RtVrfMbr/) | [nxos_loopback_interface_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/loopback_interface_vrf) | [nxos_loopback_interface_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/data-sources/loopback_interface_vrf) |
Expand Down
75 changes: 75 additions & 0 deletions docs/resources/isis_address_family.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_isis_address_family Resource - terraform-provider-nxos"
subcategory: "ISIS"
description: |-
This resource can manage the IS-IS Address Family configuration.
API Documentation: isisDomAf https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:DomAf/
Parent resources
nxos_isis_vrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_vrf
Referenced resources
nxos_vrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf
---

# nxos_isis_address_family (Resource)

This resource can manage the IS-IS Address Family configuration.

- API Documentation: [isisDomAf](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:DomAf/)

### Parent resources

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

### Referenced resources

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

## Example Usage

```terraform
resource "nxos_isis_address_family" "example" {
instance_name = "ISIS1"
vrf = "default"
address_family = "v4"
segment_routing_mpls = true
enable_bfd = false
prefix_advertise_passive_l1 = true
prefix_advertise_passive_l2 = true
}
```

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

### Required

- `address_family` (String) Address family type.
- Choices: `v4`, `v6`
- Default value: `v4`
- `instance_name` (String) IS-IS instance name.
- `vrf` (String) VRF name.

### Optional

- `device` (String) A device name from the provider configuration.
- `enable_bfd` (Boolean) Enabling BFD on all ISIS domain interfaces.
- Default value: `false`
- `prefix_advertise_passive_l1` (Boolean) Prefix advertise passive only for level-1
- Default value: `false`
- `prefix_advertise_passive_l2` (Boolean) Prefix advertise passive only level-2
- Default value: `false`
- `segment_routing_mpls` (Boolean) Segment routing for MPLS
- Default value: `false`

### Read-Only

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

## Import

Import is supported using the following syntax:

```shell
terraform import nxos_isis_address_family.example "sys/isis/inst-[ISIS1]/dom-[default]/af-[v4]"
```
63 changes: 63 additions & 0 deletions docs/resources/isis_overload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "nxos_isis_overload Resource - terraform-provider-nxos"
subcategory: "ISIS"
description: |-
This resource can manage the IS-IS overload configuration.
API Documentation: isisOverload https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Overload/
Parent resources
nxos_isis_vrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_vrf
Referenced resources
nxos_vrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf
---

# nxos_isis_overload (Resource)

This resource can manage the IS-IS overload configuration.

- API Documentation: [isisOverload](https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Overload/)

### Parent resources

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

### Referenced resources

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

## Example Usage

```terraform
resource "nxos_isis_overload" "example" {
instance_name = "ISIS1"
vrf = "default"
startup_time = 60
}
```

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

### Required

- `instance_name` (String) IS-IS instance name.
- `vrf` (String) VRF name.

### Optional

- `device` (String) A device name from the provider configuration.
- `startup_time` (Number) The overload startup time. The overload state begins when the switch boots up and ends at the time specified as the overload startup time.
- Range: `5`-`86400`
- Default value: `60`

### Read-Only

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

## Import

Import is supported using the following syntax:

```shell
terraform import nxos_isis_overload.example "sys/isis/inst-[ISIS1]/dom-[default]/overload"
```
7 changes: 7 additions & 0 deletions docs/resources/isis_vrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ description: |-
API Documentation: isisDom https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Routing%20and%20Forwarding/isis:Dom/
Parent resources
nxos_isis_instance https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_instance
Child resources
nxos_isis_address_family https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_address_familynxos_isis_overload https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_overload
Referenced resources
nxos_vrf https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf
---
Expand All @@ -21,6 +23,11 @@ This resource can manage the IS-IS VRF configuration.

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

### Child resources

- [nxos_isis_address_family](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_address_family)
- [nxos_isis_overload](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/isis_overload)

### Referenced resources

- [nxos_vrf](https://registry.terraform.io/providers/CiscoDevNet/nxos/latest/docs/resources/vrf)
Expand Down
5 changes: 5 additions & 0 deletions examples/data-sources/nxos_isis_address_family/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "nxos_isis_address_family" "example" {
instance_name = "ISIS1"
vrf = "default"
address_family = "v4"
}
4 changes: 4 additions & 0 deletions examples/data-sources/nxos_isis_overload/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "nxos_isis_overload" "example" {
instance_name = "ISIS1"
vrf = "default"
}
1 change: 1 addition & 0 deletions examples/resources/nxos_isis_address_family/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import nxos_isis_address_family.example "sys/isis/inst-[ISIS1]/dom-[default]/af-[v4]"
9 changes: 9 additions & 0 deletions examples/resources/nxos_isis_address_family/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "nxos_isis_address_family" "example" {
instance_name = "ISIS1"
vrf = "default"
address_family = "v4"
segment_routing_mpls = true
enable_bfd = false
prefix_advertise_passive_l1 = true
prefix_advertise_passive_l2 = true
}
1 change: 1 addition & 0 deletions examples/resources/nxos_isis_overload/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import nxos_isis_overload.example "sys/isis/inst-[ISIS1]/dom-[default]/overload"
5 changes: 5 additions & 0 deletions examples/resources/nxos_isis_overload/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "nxos_isis_overload" "example" {
instance_name = "ISIS1"
vrf = "default"
startup_time = 60
}
82 changes: 82 additions & 0 deletions gen/definitions/isis_address_family.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
name: ISIS Address Family
class_name: isisDomAf
dn: sys/isis/inst-[%s]/dom-[%s]/af-[%s]
ds_description: This data source can read the IS-IS Address Family configuration.
res_description: This resource can manage the IS-IS Address Family configuration.
doc_path: Routing%20and%20Forwarding/isis:DomAf/
doc_category: ISIS
parents:
- ISIS VRF
references:
- VRF
attributes:
- nxos_name: inst
tf_name: instance_name
type: String
id: true
reference_only: true
description: 'IS-IS instance name.'
example: ISIS1
- nxos_name: name
tf_name: vrf
type: String
id: true
description: 'VRF name.'
example: default
- nxos_name: type
tf_name: address_family
type: String
id: true
description: 'Address family type.'
enum_values:
- v4
- v6
default_value: v4
example: v4
- nxos_name: srMpls
tf_name: segment_routing_mpls
type: Bool
description: 'Segment routing for MPLS '
default_value: false
example: true
- nxos_name: enableBfd
tf_name: enable_bfd
type: Bool
description: 'Enabling BFD on all ISIS domain interfaces.'
default_value: false
example: false
- nxos_name: advPassiveLvl1
tf_name: prefix_advertise_passive_l1
type: Bool
description: 'Prefix advertise passive only for level-1'
default_value: false
example: true
- nxos_name: advPassiveLvl2
tf_name: prefix_advertise_passive_l2
type: Bool
description: 'Prefix advertise passive only level-2'
default_value: false
example: true
test_prerequisites:
- dn: sys/fm/isis
class_name: fmIsis
no_delete: true
attributes:
- name: adminSt
value: enabled
- dn: sys/isis
class_name: isisEntity
dependencies: [0]
- dn: sys/isis/inst-[ISIS1]
class_name: isisInst
attributes:
- name: name
value: ISIS1
dependencies: [1]
- dn: sys/isis/inst-[ISIS1]/dom-[default]
class_name: isisDom
attributes:
- name: name
value: default
dependencies: [2]
Loading

0 comments on commit 71be584

Please sign in to comment.