Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ website/node_modules
*.iml
*.test
*.iml
.env

website/vendor

Expand Down
14 changes: 7 additions & 7 deletions docs/data-sources/restconf.md → docs/data-sources/yang.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "iosxe_restconf Data Source - terraform-provider-iosxe"
page_title: "iosxe_yang Data Source - terraform-provider-iosxe"
subcategory: "General"
description: |-
This data source can retrieve one or more attributes via RESTCONF.
This data source can retrieve one or more attributes via YANG paths.
---

# iosxe_restconf (Data Source)
# iosxe_yang (Data Source)

This data source can retrieve one or more attributes via RESTCONF.
This data source can retrieve one or more attributes via YANG paths.

## Example Usage

```terraform
data "iosxe_restconf" "example" {
path = "Cisco-IOS-XE-native:native/banner/login"
data "iosxe_yang" "example" {
path = "/Cisco-IOS-XE-native:native/banner/login"
}
```

Expand All @@ -23,7 +23,7 @@ data "iosxe_restconf" "example" {

### Required

- `path` (String) A RESTCONF path, e.g. `openconfig-interfaces:interfaces`.
- `path` (String) A YANG path, e.g. `openconfig-interfaces:interfaces`.

### Optional

Expand Down
10 changes: 7 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ provider "iosxe" {
### Optional

- `devices` (Attributes List) This can be used to manage a list of devices from a single provider. All devices must use the same credentials. Each resource and data source has an optional attribute named `device`, which can then select a device by its name from this list. (see [below for nested schema](#nestedatt--devices))
- `host` (String) Hostname or IP address of the Cisco IOS-XE device. Optionally a port can be added with `:port`. Default port is `443` for RESTCONF and `830` for NETCONF. This can also be set as the IOSXE_HOST environment variable.
- `insecure` (Boolean) Allow insecure HTTPS client. This can also be set as the IOSXE_INSECURE environment variable. Defaults to `true`.
- `lock_release_timeout` (Number) Number of seconds to wait for the device database lock to be released. This can also be set as the IOSXE_LOCK_RELEASE_TIMEOUT environment variable. Defaults to `120`.
- `password` (String, Sensitive) Password for the IOS-XE device. This can also be set as the IOSXE_PASSWORD environment variable.
- `protocol` (String) Protocol to use for device communication. Either `restconf` (HTTPS) or `netconf` (SSH). This can also be set as the IOSXE_PROTOCOL environment variable. Defaults to `restconf`.
- `retries` (Number) Number of retries for REST API calls. This can also be set as the IOSXE_RETRIES environment variable. Defaults to `10`.
- `reuse_connection` (Boolean) Keep NETCONF connections open between operations for better performance. When disabled, connections are closed and reopened for each operation. Only applies to NETCONF protocol. This can also be set as the IOSXE_REUSE_CONNECTION environment variable. Defaults to `true`.
- `selected_devices` (List of String) This can be used to select a list of devices to manage from the `devices` list. Selected devices will be managed while other devices will be skipped and their state will be frozen. This can be used to deploy changes to a subset of devices. Defaults to all devices.
- `url` (String) URL of the Cisco IOS-XE device. Optionally a port can be added with `:12345`. The default port is `443`. This can also be set as the IOSXE_URL environment variable.
- `url` (String, Deprecated) URL of the Cisco IOS-XE device for RESTCONF protocol. Optionally a port can be added with `:12345`. The default port is `443`. This can also be set as the IOSXE_URL environment variable. **Deprecated: Use `host` instead for protocol-agnostic configuration.**
- `username` (String) Username for the IOS-XE device. This can also be set as the IOSXE_USERNAME environment variable.

<a id="nestedatt--devices"></a>
Expand All @@ -65,8 +68,9 @@ provider "iosxe" {
Required:

- `name` (String) Device name.
- `url` (String) URL of the Cisco IOS-XE device.

Optional:

- `managed` (Boolean) Enable or disable device management. This can be used to temporarily skip a device due to maintainance for example. Defaults to `true`.
- `host` (String) Hostname or IP address of the Cisco IOS-XE device. Optionally a port can be added with `:port`.
- `managed` (Boolean) Enable or disable device management. This can be used to temporarily skip a device due to maintainance for example. Defaults to `true`.
- `url` (String, Deprecated) URL of the Cisco IOS-XE device for RESTCONF protocol. **Deprecated: Use `host` instead.**
20 changes: 10 additions & 10 deletions docs/resources/restconf.md → docs/resources/yang.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "iosxe_restconf Resource - terraform-provider-iosxe"
page_title: "iosxe_yang Resource - terraform-provider-iosxe"
subcategory: "General"
description: |-
Manages IOS-XE objects via RESTCONF calls. This resource can only manage a single object. It is able to read the state and therefore reconcile configuration drift.
Manages IOS-XE objects via YANG paths. This resource can only manage a single object. It is able to read the state and therefore reconcile configuration drift.
---

# iosxe_restconf (Resource)
# iosxe_yang (Resource)

Manages IOS-XE objects via RESTCONF calls. This resource can only manage a single object. It is able to read the state and therefore reconcile configuration drift.
Manages IOS-XE objects via YANG paths. This resource can only manage a single object. It is able to read the state and therefore reconcile configuration drift.

## Example Usage

```terraform
resource "iosxe_restconf" "simple" {
path = "Cisco-IOS-XE-native:native/banner/login"
resource "iosxe_yang" "simple" {
path = "/Cisco-IOS-XE-native:native/banner/login"
attributes = {
banner = "My Banner"
}
}

resource "iosxe_restconf" "nested_list" {
path = "Cisco-IOS-XE-native:native/ip"
resource "iosxe_yang" "nested_list" {
path = "/Cisco-IOS-XE-native:native/ip"
attributes = {
source-route = "true"
}
Expand All @@ -42,7 +42,7 @@ resource "iosxe_restconf" "nested_list" {

### Required

- `path` (String) A RESTCONF path, e.g. `openconfig-interfaces:interfaces`.
- `path` (String) A YANG path, e.g. `openconfig-interfaces:interfaces`.

### Optional

Expand Down Expand Up @@ -75,5 +75,5 @@ Import is supported using the following syntax:
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
terraform import iosxe_restconf.example "Cisco-IOS-XE-native:native/banner/login"
terraform import iosxe_yang.example "/Cisco-IOS-XE-native:native/banner/login"
```
3 changes: 0 additions & 3 deletions examples/data-sources/iosxe_restconf/data-source.tf

This file was deleted.

3 changes: 3 additions & 0 deletions examples/data-sources/iosxe_yang/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "iosxe_yang" "example" {
path = "/Cisco-IOS-XE-native:native/banner/login"
}
1 change: 0 additions & 1 deletion examples/resources/iosxe_restconf/import.sh

This file was deleted.

1 change: 1 addition & 0 deletions examples/resources/iosxe_yang/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import iosxe_yang.example "/Cisco-IOS-XE-native:native/banner/login"
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
resource "iosxe_restconf" "simple" {
path = "Cisco-IOS-XE-native:native/banner/login"
resource "iosxe_yang" "simple" {
path = "/Cisco-IOS-XE-native:native/banner/login"
attributes = {
banner = "My Banner"
}
}

resource "iosxe_restconf" "nested_list" {
path = "Cisco-IOS-XE-native:native/ip"
resource "iosxe_yang" "nested_list" {
path = "/Cisco-IOS-XE-native:native/ip"
attributes = {
source-route = "true"
}
Expand Down
4 changes: 2 additions & 2 deletions gen/definitions/aaa.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: AAA
path: Cisco-IOS-XE-native:native/aaa
path: /Cisco-IOS-XE-native:native/aaa
no_delete_attributes: true
doc_category: AAA
test_tags: [AAA]
Expand Down Expand Up @@ -158,7 +158,7 @@ attributes:
exclude_test: true

test_prerequisites:
- path: Cisco-IOS-XE-native:native/vrf/definition=VRF1
- path: /Cisco-IOS-XE-native:native/vrf/definition[name=VRF1]
no_delete: true
attributes:
- name: name
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/aaa_accounting.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: AAA Accounting
path: Cisco-IOS-XE-native:native/aaa/Cisco-IOS-XE-aaa:accounting
path: /Cisco-IOS-XE-native:native/aaa/Cisco-IOS-XE-aaa:accounting
doc_category: AAA
attributes:
- yang_name: update/update-choice/newinfo/newinfo/periodic
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/aaa_authentication.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: AAA Authentication
path: Cisco-IOS-XE-native:native/aaa/Cisco-IOS-XE-aaa:authentication
path: /Cisco-IOS-XE-native:native/aaa/Cisco-IOS-XE-aaa:authentication
doc_category: AAA
test_tags: [AAA]
attributes:
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/aaa_authorization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: AAA Authorization
path: Cisco-IOS-XE-native:native/aaa/Cisco-IOS-XE-aaa:authorization
path: /Cisco-IOS-XE-native:native/aaa/Cisco-IOS-XE-aaa:authorization
doc_category: AAA
test_tags: [AAA]
attributes:
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/access_list_extended.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Access List Extended
path: Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:extended=%v
path: /Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:extended[name=%v]
no_delete_attributes: true
doc_category: System
attributes:
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/access_list_role_based.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Access List Role Based
path: Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:role-based=%v
path: /Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:role-based[name=%v]
no_delete_attributes: true
doc_category: System
attributes:
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/access_list_standard.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Access List Standard
path: Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard=%v
path: /Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard[name=%v]
no_delete_attributes: true
doc_category: System
attributes:
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/arp.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: ARP
path: Cisco-IOS-XE-native:native/ip/arp
path: /Cisco-IOS-XE-native:native/ip/arp
doc_category: System
attributes:
- yang_name: incomplete/entries
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/as_path_access_list.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: AS Path Access List
path: Cisco-IOS-XE-native:native/ip/as-path/Cisco-IOS-XE-bgp:access-list=%v
path: /Cisco-IOS-XE-native:native/ip/as-path/Cisco-IOS-XE-bgp:access-list[name=%v]
no_delete_attributes: true
skip_minimum_test: true
doc_category: BGP
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/banner.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Banner
path: Cisco-IOS-XE-native:native/banner
path: /Cisco-IOS-XE-native:native/banner
doc_category: System
attributes:
- yang_name: exec/banner
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/bfd.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BFD
path: Cisco-IOS-XE-native:native/bfd
path: /Cisco-IOS-XE-native:native/bfd
doc_category: BFD
attributes:
- yang_name: Cisco-IOS-XE-bfd:map/ipv4-list-with-both-vrf/ipv4
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/bfd_template_multi_hop.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BFD Template Multi Hop
path: Cisco-IOS-XE-native:native/bfd-template/Cisco-IOS-XE-bfd:multi-hop=%s
path: /Cisco-IOS-XE-native:native/bfd-template/Cisco-IOS-XE-bfd:multi-hop[name=%s]
no_delete_attributes: true
doc_category: BFD
attributes:
Expand Down
2 changes: 1 addition & 1 deletion gen/definitions/bfd_template_single_hop.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BFD Template Single Hop
path: Cisco-IOS-XE-native:native/bfd-template/Cisco-IOS-XE-bfd:single-hop=%v
path: /Cisco-IOS-XE-native:native/bfd-template/Cisco-IOS-XE-bfd:single-hop[name=%v]
no_delete_attributes: true
doc_category: BFD
attributes:
Expand Down
4 changes: 2 additions & 2 deletions gen/definitions/bgp.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BGP
path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=%v
path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=%v]
doc_category: BGP
attributes:
- yang_name: id
Expand All @@ -21,7 +21,7 @@ attributes:
tf_name: router_id_ip
example: 172.16.255.1
test_prerequisites:
- path: Cisco-IOS-XE-native:native/interface/Loopback=100
- path: /Cisco-IOS-XE-native:native/interface/Loopback[name=100]
attributes:
- name: name
value: 100
Expand Down
4 changes: 2 additions & 2 deletions gen/definitions/bgp_address_family_ipv4.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BGP Address Family IPv4
path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=%v/address-family/no-vrf/ipv4=%s
path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=%v]/address-family/no-vrf/ipv4[af-name=%s]
doc_category: BGP
attributes:
- yang_name: id
Expand Down Expand Up @@ -79,7 +79,7 @@ attributes:
example: 200

test_prerequisites:
- path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=65000
- path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=65000]
attributes:
- name: id
value: 65000
8 changes: 4 additions & 4 deletions gen/definitions/bgp_address_family_ipv4_vrf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BGP Address Family IPv4 VRF
path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=%v/address-family/with-vrf/ipv4=%s
path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=%v]/address-family/with-vrf/ipv4[af-name=%s]
skip_minimum_test: true
doc_category: BGP
attributes:
Expand Down Expand Up @@ -112,7 +112,7 @@ attributes:
example: 200

test_prerequisites:
- path: Cisco-IOS-XE-native:native/vrf/definition=VRF1
- path: /Cisco-IOS-XE-native:native/vrf/definition[name=VRF1]
no_delete: true
attributes:
- name: name
Expand All @@ -121,12 +121,12 @@ test_prerequisites:
value: 1:1
- name: address-family/ipv4
value: ""
- path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=65000
- path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=65000]
attributes:
- name: id
value: 65000
dependencies: [0]
- path: Cisco-IOS-XE-native:native/interface/Loopback=101
- path: /Cisco-IOS-XE-native:native/interface/Loopback[name=101]
attributes:
- name: name
value: 101
Expand Down
6 changes: 3 additions & 3 deletions gen/definitions/bgp_address_family_ipv6.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BGP Address Family IPv6
path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=%v/address-family/no-vrf/ipv6=%s
path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=%v]/address-family/no-vrf/ipv6[af-name=%s]
doc_category: BGP
attributes:
- yang_name: id
Expand All @@ -27,11 +27,11 @@ attributes:
- yang_name: backdoor
example: true
test_prerequisites:
- path: Cisco-IOS-XE-native:native/ipv6
- path: /Cisco-IOS-XE-native:native/ipv6
attributes:
- name: unicast-routing
value: ""
- path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=65000
- path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=65000]
attributes:
- name: id
value: 65000
8 changes: 4 additions & 4 deletions gen/definitions/bgp_address_family_ipv6_vrf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: BGP Address Family IPv6 VRF
path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=%v/address-family/with-vrf/ipv6=%s
path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=%v]/address-family/with-vrf/ipv6[af-name=%s]
skip_minimum_test: true
doc_category: BGP
attributes:
Expand Down Expand Up @@ -40,11 +40,11 @@ attributes:
- yang_name: evpn
example: false
test_prerequisites:
- path: Cisco-IOS-XE-native:native/ipv6
- path: /Cisco-IOS-XE-native:native/ipv6
attributes:
- name: unicast-routing
value: ""
- path: Cisco-IOS-XE-native:native/vrf/definition=VRF1
- path: /Cisco-IOS-XE-native:native/vrf/definition[name=VRF1]
no_delete: true
attributes:
- name: name
Expand All @@ -54,7 +54,7 @@ test_prerequisites:
- name: address-family/ipv6
value: ""
dependencies: [0]
- path: Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp=65000
- path: /Cisco-IOS-XE-native:native/router/Cisco-IOS-XE-bgp:bgp[id=65000]
attributes:
- name: id
value: 65000
Expand Down
Loading