From f723e2f9889a6cc65a845a155ae0f3200372e01e Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Sun, 24 Mar 2024 14:55:56 -0400 Subject: [PATCH] Add `builtins` directive configuration example. Closes #238 --- docs/pages/configuration/devices.mdx | 69 +++++++++++++++++++++------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/docs/pages/configuration/devices.mdx b/docs/pages/configuration/devices.mdx index 58ba7088..df1c40e3 100644 --- a/docs/pages/configuration/devices.mdx +++ b/docs/pages/configuration/devices.mdx @@ -1,22 +1,22 @@ Each configured device may have the following parameters: -| Parameter | Type | Default Value | Description | -| :------------------ | :-------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | String | | Display name of the device. | -| `description` | String | | Description of the device, displayed as a subtle label. | -| `avatar` | String | | Path to an avatar/logo image for this site. Used when [`web.location_display_mode`](/config-file-reference/web-ui) is set to `gallery`. | -| `address` | String | | IPv4 address, IPv6 address, or hostname of the device. | -| `group` | String | | Group name, used to visually group devices in the UI. | -| `port` | Number | | TCP port on which to connect to the device. | -| `platform` | String | | Device platform/OS. Must be a [supported platform](/supported-platforms). | -| `structured_output` | Boolean | `true` | Disable structured output for a device that supports it. | -| `directives` | List of Strings | | Enable referenced directives configured in the [directives config file](/configuration/directives-file-reference). | -| `driver` | String | netmiko | Specify which driver to use for this device. Currently, only `netmiko` is supported. | -| `driver_config` | Mapping | | Mapping/dict of options to pass to the connection driver. | -| `attrs` | Mapping | | Mapping/dict of variables, as referenced in configured directives. | -| `credential` | Mapping | | Mapping/dict of a [credential configuration](#credential-onfiguration). | -| `http` | Mapping | | Mapping/dict of HTTP client options, if this device is connected via HTTP. | -| `proxy` | Mapping | | Mapping/dict of SSH proxy to use for this device's requests. | +| Parameter | Type | Default Value | Description | +| :------------------ | :-------------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | String | | Display name of the device. | +| `description` | String | | Description of the device, displayed as a subtle label. | +| `avatar` | String | | Path to an avatar/logo image for this site. Used when [`web.location_display_mode`](configuration/config/web-ui.mdx) is set to `gallery`. | +| `address` | String | | IPv4 address, IPv6 address, or hostname of the device. | +| `group` | String | | Group name, used to visually group devices in the UI. | +| `port` | Number | | TCP port on which to connect to the device. | +| `platform` | String | | Device platform/OS. Must be a [supported platform](platforms.mdx). | +| `structured_output` | Boolean | `true` | Disable structured output for a device that supports it. | +| `directives` | List of Strings | | Enable referenced directives configured in the [directives config file](configuration/directives.mdx). | +| `driver` | String | netmiko | Specify which driver to use for this device. Currently, only `netmiko` is supported. | +| `driver_config` | Mapping | | Mapping/dict of options to pass to the connection driver. | +| `attrs` | Mapping | | Mapping/dict of variables, as referenced in configured directives. | +| `credential` | Mapping | | Mapping/dict of a [credential configuration](#credential-onfiguration). | +| `http` | Mapping | | Mapping/dict of HTTP client options, if this device is connected via HTTP. | +| `proxy` | Mapping | | Mapping/dict of SSH proxy to use for this device's requests. | ## Credential Configuration @@ -77,6 +77,8 @@ devices: ## With Directives +In this example, an additional directive `cisco-show-lldp-neighbors` is added to the built-in directives. + ```yaml filename="devices.yaml" copy {8-9} devices: - name: New York, NY @@ -89,6 +91,39 @@ devices: - cisco-show-lldp-neighbors ``` +## Disable Built-in Directives + +In this example, _only_ the `cisco-show-lldp-neighbors` directive will be available. Built-in directives are disabled. + +```yaml filename="devices.yaml" copy {8-10} +devices: + - name: New York, NY + address: 192.0.2.1 + platform: cisco_ios + credential: + username: you + password: your password + directives: + - builtin: false + - cisco-show-lldp-neighbors +``` + +## Enable Specifc Built-in Directives + +In this example, only specified built-in directives are made available. + +```yaml filename="devices.yaml" copy {8-9} +devices: + - name: New York, NY + address: 192.0.2.1 + platform: cisco_ios + credential: + username: you + password: your password + directives: + - builtin: [bgp_route, traceroute] +``` + ## With an SSH Proxy ```yaml filename="devices.yaml" copy {8-12}