bb-eco template apply
Apply a configuration template to one or more devices
Usage
bb-eco template apply <targets>... [options]
Arguments
| Name | Description |
|---|---|
<targets> | One or more devices (IP address with an optional :port, MAC address, or device name) followed by the template file path (.json). With --all, just the file. |
Options
| Option | Description |
|---|---|
--all | Apply to every discovered ED and ES device instead of naming them. |
--csv | Output in CSV format |
--discovery-seconds <discovery-seconds> | With --all: how long to listen for devices before applying. [default: 5] |
--dry-run | Preview changes without applying |
--force | Skip confirmation prompt |
--json | Output in JSON format |
--timeout <timeout> | Override default timeout in milliseconds |
--verbose | Enable verbose/debug output |
-?, -h, --help | Show help and usage information |
Examples
Preview what a template would change without touching the device:
bb-eco template apply 192.168.1.107 es-522-baseline.json --dry-run
DRY RUN — no changes will be applied.
[device] applying
[device] planned
[serialPorts[0]] applying
[serialPorts[0]] planned
[serialPorts[1]] applying
[serialPorts[1]] planned
[wport] applying
[wport] planned
[network] applying
[network] planned
Dry run: 3 settings would change, 29 already match.
The preview reads the device and compares every setting exactly as the apply does, then stops before each write, so its numbers are the apply's.
Apply it for real by dropping --dry-run. Sections are written in a safe order: device settings first, then each serial port (serialPorts[0] is Serial Port 1), network settings last, because a network change can drop the connection mid-apply. The summary counts template settings: values that differed and were written count as applied, values the device already had count as matched, and a device that fully matches is left untouched:
bb-eco template apply 192.168.1.107 es-522-baseline.json
Applied 3 settings; 29 already matched.
Re-running the same apply is safe, because nothing is written twice:
No changes — all 32 settings already match the device. Nothing was sent.
The template's family (and optional compatibleModels list) must match the target device; --force skips the confirmation prompt so the command can run unattended.
Deploy one configuration to many devices
Name several devices before the file and each is applied in turn, one at a time, with a report row per device (in the desktop app, see Apply one template to many devices):
bb-eco template apply 192.168.1.107 192.168.1.108 00:0A:4F:05:F7:CA es-522-baseline.json --force
Device IP Model Outcome Applied Matched Failed Detail
Line 1 192.168.1.107 ES-522 Applied 3 29 0 Applied 3 settings; 29 already matched.
Line 2 192.168.1.108 ES-522 No changes 0 32 0 No changes — all 32 settings already match the device. Nothing was sent.
ES-522 2-Port 192.168.1.109 ES-522 Failed 0 0 32 [compatibility] description.xml: Failed to fetch device description
2 of 3 device(s) applied, 1 failed.
--all applies the template to every ED and ES device found on the network (switches and edge controllers have no configuration template and are left out). Preview it first:
bb-eco template apply --all es-522-baseline.json --dry-run
For a script, add --json for one document with a row per device, or --csv for the table alone:
bb-eco template apply --all es-522-baseline.json --force --json
Exit code 0 means every device was applied, already matched, or previewed; 1 means at least one device failed, was not found, or does not take templates; 2 means no device was found.
Applying serial-port settings to an ES device is rejected with an error while a TCP client is connected to that port. Close active connections first.
This page is auto-generated from the live CLI help text. Do not edit by hand - re-run node scripts/gen-cli-reference.mjs after changes. Example sections are maintained in docs/cli-examples/ in the bb-eco repo.