Skip to content

Commit 8a6658b

Browse files
authored
feat: add attempt_timeout and total_timeout provider attributes (#623)
1 parent 60e441f commit 8a6658b

3 files changed

Lines changed: 173 additions & 1 deletion

File tree

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ provider "iosxe" {
6060

6161
### Optional
6262

63+
- `attempt_timeout` (Number) Number of seconds to wait for a single NETCONF operation attempt to complete before treating it as a transient failure and retrying. Large configuration changes (for example, a `spanning-tree` declaration covering thousands of VLANs) can take a device considerably longer than the default to process a `commit`, causing an otherwise-successful operation to be abandoned and retried. Increase this value if operations fail with `errTimeoutError: channel timeout sending input to device` despite the device still working. Note this applies to every NETCONF operation, so raising it also increases how long a genuinely unresponsive device takes to surface as an error. This can also be set as the IOSXE_ATTEMPT_TIMEOUT environment variable. Defaults to `30`.
6364
- `auto_commit` (Boolean) Automatically commit configuration changes after each resource operation. When `true` (default), each resource commits its changes immediately. When `false`, changes are left in the candidate datastore and must be explicitly committed using the `iosxe_commit` resource. **Requires reuse_connection=true when disabled**. Only applies to NETCONF protocol with candidate datastore support. This can also be set as the IOSXE_AUTO_COMMIT environment variable. Defaults to `true`.
6465
- `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))
6566
- `host` (String) Hostname or IP address of the Cisco IOS-XE device. Optionally a port can be added with `:port`. Default port is `830`. This can also be set as the IOSXE_HOST environment variable.
@@ -69,6 +70,7 @@ provider "iosxe" {
6970
- `retries` (Number) Number of retries for NETCONF API calls. This can also be set as the IOSXE_RETRIES environment variable. Defaults to `3`.
7071
- `reuse_connection` (Boolean) Keep NETCONF connections open between operations for better performance. **Required when auto_commit=false** - Manual commit mode requires persistent connections to maintain staged candidate configuration changes. 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`.
7172
- `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.
73+
- `total_timeout` (Number) Number of seconds allowed for a NETCONF operation in total, across all retry attempts. This is an outer ceiling: once it expires the operation fails immediately, regardless of how many retries remain or how much of `attempt_timeout` is left. It must therefore be larger than `attempt_timeout` multiplied by the number of attempts, otherwise raising `attempt_timeout` has no effect. This can also be set as the IOSXE_TOTAL_TIMEOUT environment variable. Defaults to `120`.
7274
- `username` (String) Username for the IOS-XE device. This can also be set as the IOSXE_USERNAME environment variable.
7375

7476
<a id="nestedatt--devices"></a>

gen/templates/provider.go

Lines changed: 86 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/provider.go

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)