Skip to content

Commit f723e2f

Browse files
committed
Add builtins directive configuration example. Closes #238
1 parent 8ab9caa commit f723e2f

File tree

1 file changed

+52
-17
lines changed

1 file changed

+52
-17
lines changed

docs/pages/configuration/devices.mdx

+52-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
Each configured device may have the following parameters:
22

3-
| Parameter | Type | Default Value | Description |
4-
| :------------------ | :-------------- | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
5-
| `name` | String | | Display name of the device. |
6-
| `description` | String | | Description of the device, displayed as a subtle label. |
7-
| `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`. |
8-
| `address` | String | | IPv4 address, IPv6 address, or hostname of the device. |
9-
| `group` | String | | Group name, used to visually group devices in the UI. |
10-
| `port` | Number | | TCP port on which to connect to the device. |
11-
| `platform` | String | | Device platform/OS. Must be a [supported platform](/supported-platforms). |
12-
| `structured_output` | Boolean | `true` | Disable structured output for a device that supports it. |
13-
| `directives` | List of Strings | | Enable referenced directives configured in the [directives config file](/configuration/directives-file-reference). |
14-
| `driver` | String | netmiko | Specify which driver to use for this device. Currently, only `netmiko` is supported. |
15-
| `driver_config` | Mapping | | Mapping/dict of options to pass to the connection driver. |
16-
| `attrs` | Mapping | | Mapping/dict of variables, as referenced in configured directives. |
17-
| `credential` | Mapping | | Mapping/dict of a [credential configuration](#credential-onfiguration). |
18-
| `http` | Mapping | | Mapping/dict of HTTP client options, if this device is connected via HTTP. |
19-
| `proxy` | Mapping | | Mapping/dict of SSH proxy to use for this device's requests. |
3+
| Parameter | Type | Default Value | Description |
4+
| :------------------ | :-------------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------- |
5+
| `name` | String | | Display name of the device. |
6+
| `description` | String | | Description of the device, displayed as a subtle label. |
7+
| `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`. |
8+
| `address` | String | | IPv4 address, IPv6 address, or hostname of the device. |
9+
| `group` | String | | Group name, used to visually group devices in the UI. |
10+
| `port` | Number | | TCP port on which to connect to the device. |
11+
| `platform` | String | | Device platform/OS. Must be a [supported platform](platforms.mdx). |
12+
| `structured_output` | Boolean | `true` | Disable structured output for a device that supports it. |
13+
| `directives` | List of Strings | | Enable referenced directives configured in the [directives config file](configuration/directives.mdx). |
14+
| `driver` | String | netmiko | Specify which driver to use for this device. Currently, only `netmiko` is supported. |
15+
| `driver_config` | Mapping | | Mapping/dict of options to pass to the connection driver. |
16+
| `attrs` | Mapping | | Mapping/dict of variables, as referenced in configured directives. |
17+
| `credential` | Mapping | | Mapping/dict of a [credential configuration](#credential-onfiguration). |
18+
| `http` | Mapping | | Mapping/dict of HTTP client options, if this device is connected via HTTP. |
19+
| `proxy` | Mapping | | Mapping/dict of SSH proxy to use for this device's requests. |
2020

2121
## Credential Configuration
2222

@@ -77,6 +77,8 @@ devices:
7777
7878
## With Directives
7979
80+
In this example, an additional directive `cisco-show-lldp-neighbors` is added to the built-in directives.
81+
8082
```yaml filename="devices.yaml" copy {8-9}
8183
devices:
8284
- name: New York, NY
@@ -89,6 +91,39 @@ devices:
8991
- cisco-show-lldp-neighbors
9092
```
9193

94+
## Disable Built-in Directives
95+
96+
In this example, _only_ the `cisco-show-lldp-neighbors` directive will be available. Built-in directives are disabled.
97+
98+
```yaml filename="devices.yaml" copy {8-10}
99+
devices:
100+
- name: New York, NY
101+
address: 192.0.2.1
102+
platform: cisco_ios
103+
credential:
104+
username: you
105+
password: your password
106+
directives:
107+
- builtin: false
108+
- cisco-show-lldp-neighbors
109+
```
110+
111+
## Enable Specifc Built-in Directives
112+
113+
In this example, only specified built-in directives are made available.
114+
115+
```yaml filename="devices.yaml" copy {8-9}
116+
devices:
117+
- name: New York, NY
118+
address: 192.0.2.1
119+
platform: cisco_ios
120+
credential:
121+
username: you
122+
password: your password
123+
directives:
124+
- builtin: [bgp_route, traceroute]
125+
```
126+
92127
## With an SSH Proxy
93128

94129
```yaml filename="devices.yaml" copy {8-12}

0 commit comments

Comments
 (0)