How sync works
circuit sync copies what your project says into another system. It goes one way, from your project to that system. It reads only the project and that system, and never logs in to a device.
| Target | What Circuit writes there |
|---|---|
| NetBox | Devices, ports, VLANs, addresses, and cables |
| LibreNMS | Every device to monitor, with its SNMP settings, and a device group for each site |
| PeeringDB | Your network's presence at each internet exchange |
| Prometheus | Two files in your project: targets for Prometheus, credentials for the SNMP exporter |
1Password is different. Circuit reads your secrets from it, and never writes to it.
Set up a target
Write the target in circuit({ integrations }), in circuit.ts, as its page shows. Keep a token or an API key in your secrets, with secret("NAME").
Run a sync
sh
circuit sync netbox # shows what would change, then asks
circuit sync netbox --confirm # sends without asking
circuit sync # pick the target from a list- Circuit reads the project. It stops on an error, as
applydoes. - It asks for your secrets' password if it needs a secret, such as the target's token.
- It reads the other system and shows the plan.
- It asks Send these changes? The answer is No by default.
- It sends the changes, then reads the other system again. If something still differs, it shows what, and exits 1.
Read the plan
+makes an object,~changes one, and-deletes one. A change shows each field before and after.- Left alone lists what Circuit sees but doesn't change, each with the reason. Read it, because it often says what to remove by hand.
- A secret's value never shows.
Use it in CI
Without a terminal and without --confirm, circuit sync <target> sends nothing. It fails the job when the other system no longer matches the project. See Run in CI.
Several networks in one project
If several networks in one project use the same system, Circuit plans them together. So a sync for one network never deletes what another network made.
| Target | Planned together when the networks have |
|---|---|
| NetBox | The same url |
| LibreNMS | The same url |
| PeeringDB | The same asn |
| Prometheus | The same targets and auths files |