# ytti/oxidized architecture

> Architecture diagram of the GitHub repository ytti/oxidized, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ytti/oxidized
- Repository: https://github.com/ytti/oxidized

## Overview

Oxidized backs up network-device configurations. The principal workflow loads device inventory and configuration, schedules retrieval jobs, connects through a device-specific input, applies a model to collect and format configuration, and persists revisions through an output. Sources, inputs, models, outputs, and hooks are extensible; documented capabilities also include API-triggered fetches, node reloads, and change-event-triggered fetches. Most runtime wiring was not excerpted, so uncertain connections are marked dashed with no evidence path; the README documents the product capabilities and extra/syslog.rb references the REST client.

Main entry points: [`lib/oxidized/manager.rb`](https://github.com/ytti/oxidized/blob/master/lib/oxidized/manager.rb) (Plugin manager), [`lib/oxidized/node.rb`](https://github.com/ytti/oxidized/blob/master/lib/oxidized/node.rb) (Device node), [`lib/oxidized/output`](https://github.com/ytti/oxidized/tree/master/lib/oxidized/output) (Output backends), [`lib/oxidized/nodes.rb`](https://github.com/ytti/oxidized/blob/master/lib/oxidized/nodes.rb) (Node inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Configuration and inventory"]
  node_config["Configuration<br/>[config.rb]"]
  node_manager["Plugin manager<br/>[manager.rb]"]
  node_sources["Inventory sources"]
  node_nodes["Node inventory<br/>[nodes.rb]"]
end

subgraph group_retrieval["Device retrieval"]
  node_scheduler["Job scheduler<br/>[jobs.rb]"]
  node_job["Retrieval job<br/>[job.rb]"]
  node_worker["Worker pool<br/>[worker.rb]"]
  node_node["Device node<br/>[node.rb]"]
  node_inputs["Connection inputs"]
  node_models["Device models"]
end

subgraph group_persistence["Storage and notifications"]
  node_outputs["Output backends"]
  node_repository[("Config repository")]
  node_hooks["Hooks"]
end

subgraph group_operations["Operations"]
  node_cli["CLI<br/>[cli.rb]"]
  node_rest_api["REST API"]
  node_syslog["Syslog helper<br/>[syslog.rb]"]
  node_rest_client["REST client<br/>[rest_client.rb]"]
end

node_operator(("Operator"))
node_device(("Network devices"))
node_remote_repo[("Remote Git")]

node_operator -.->|"starts"| node_cli
node_cli -.->|"loads"| node_config
node_config -.->|"configures plugins"| node_manager
node_manager -->|"loads source"| node_sources
node_manager -->|"loads input"| node_inputs
node_manager -->|"loads output"| node_outputs
node_manager -->|"loads model"| node_models
node_manager -->|"loads hook"| node_hooks
node_sources -.->|"provide inventory"| node_nodes
node_nodes -.->|"schedule nodes"| node_scheduler
node_scheduler -.->|"queues retrieval"| node_job
node_worker -.->|"processes"| node_job
node_job -.->|"retrieves config"| node_node
node_node -.->|"connects through"| node_inputs
node_inputs -.->|"fetches config"| node_device
node_node -.->|"formats config"| node_models
node_worker -.->|"stores config"| node_outputs
node_outputs -.->|"writes revisions"| node_repository
node_outputs -.->|"triggers hooks"| node_hooks
node_hooks -.->|"pushes changes"| node_remote_repo
node_operator -.->|"requests operations"| node_rest_api
node_rest_api -.->|"queues node"| node_scheduler
node_rest_api -.->|"reloads inventory"| node_nodes
node_rest_api -.->|"fetches configuration"| node_node
node_device -.->|"signals changes"| node_syslog
node_syslog -->|"requests node queue"| node_rest_client

click node_cli "https://github.com/ytti/oxidized/blob/master/lib/oxidized/cli.rb"
click node_config "https://github.com/ytti/oxidized/blob/master/lib/oxidized/config.rb"
click node_manager "https://github.com/ytti/oxidized/blob/master/lib/oxidized/manager.rb"
click node_sources "https://github.com/ytti/oxidized/tree/master/lib/oxidized/source"
click node_nodes "https://github.com/ytti/oxidized/blob/master/lib/oxidized/nodes.rb"
click node_scheduler "https://github.com/ytti/oxidized/blob/master/lib/oxidized/jobs.rb"
click node_job "https://github.com/ytti/oxidized/blob/master/lib/oxidized/job.rb"
click node_worker "https://github.com/ytti/oxidized/blob/master/lib/oxidized/worker.rb"
click node_node "https://github.com/ytti/oxidized/blob/master/lib/oxidized/node.rb"
click node_inputs "https://github.com/ytti/oxidized/tree/master/lib/oxidized/input"
click node_models "https://github.com/ytti/oxidized/tree/master/lib/oxidized/model"
click node_outputs "https://github.com/ytti/oxidized/tree/master/lib/oxidized/output"
click node_hooks "https://github.com/ytti/oxidized/tree/master/lib/oxidized/hook"
click node_syslog "https://github.com/ytti/oxidized/blob/master/extra/syslog.rb"
click node_rest_client "https://github.com/ytti/oxidized/blob/master/extra/rest_client.rb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config,node_manager,node_sources,node_nodes toneBlue
class node_scheduler,node_job,node_worker,node_node,node_inputs,node_models,node_remote_repo toneAmber
class node_outputs,node_repository,node_hooks toneMint
class node_cli,node_rest_api,node_syslog,node_rest_client toneRose
class node_operator,node_device toneIndigo
```

## Components

### Configuration and inventory

- [Configuration](https://github.com/ytti/oxidized/blob/master/lib/oxidized/config.rb): `lib/oxidized/config.rb`
- [Plugin manager](https://github.com/ytti/oxidized/blob/master/lib/oxidized/manager.rb): `lib/oxidized/manager.rb`
- [Inventory sources](https://github.com/ytti/oxidized/tree/master/lib/oxidized/source): `lib/oxidized/source`
- [Node inventory](https://github.com/ytti/oxidized/blob/master/lib/oxidized/nodes.rb): `lib/oxidized/nodes.rb`

### Device retrieval

- [Job scheduler](https://github.com/ytti/oxidized/blob/master/lib/oxidized/jobs.rb): `lib/oxidized/jobs.rb`
- [Retrieval job](https://github.com/ytti/oxidized/blob/master/lib/oxidized/job.rb): `lib/oxidized/job.rb`
- [Worker pool](https://github.com/ytti/oxidized/blob/master/lib/oxidized/worker.rb): `lib/oxidized/worker.rb`
- [Device node](https://github.com/ytti/oxidized/blob/master/lib/oxidized/node.rb): `lib/oxidized/node.rb`
- [Connection inputs](https://github.com/ytti/oxidized/tree/master/lib/oxidized/input): `lib/oxidized/input`
- [Device models](https://github.com/ytti/oxidized/tree/master/lib/oxidized/model): `lib/oxidized/model`

### Storage and notifications

- [Output backends](https://github.com/ytti/oxidized/tree/master/lib/oxidized/output): `lib/oxidized/output`
- **Config repository**
- [Hooks](https://github.com/ytti/oxidized/tree/master/lib/oxidized/hook): `lib/oxidized/hook`

### Operations

- [CLI](https://github.com/ytti/oxidized/blob/master/lib/oxidized/cli.rb): `lib/oxidized/cli.rb`
- **REST API**
- [Syslog helper](https://github.com/ytti/oxidized/blob/master/extra/syslog.rb): `extra/syslog.rb`
- [REST client](https://github.com/ytti/oxidized/blob/master/extra/rest_client.rb): `extra/rest_client.rb`

### Other components

- **Operator**
- **Network devices**
- **Remote Git**

## Connections

- Operator → CLI: starts
- CLI → Configuration: loads
- Configuration → Plugin manager: configures plugins
- Plugin manager → Inventory sources: loads source
- Plugin manager → Connection inputs: loads input
- Plugin manager → Output backends: loads output
- Plugin manager → Device models: loads model
- Plugin manager → Hooks: loads hook
- Inventory sources → Node inventory: provide inventory
- Node inventory → Job scheduler: schedule nodes
- Job scheduler → Retrieval job: queues retrieval
- Worker pool → Retrieval job: processes
- Retrieval job → Device node: retrieves config
- Device node → Connection inputs: connects through
- Connection inputs → Network devices: fetches config
- Device node → Device models: formats config
- Worker pool → Output backends: stores config
- Output backends → Config repository: writes revisions
- Output backends → Hooks: triggers hooks
- Hooks → Remote Git: pushes changes
- Operator → REST API: requests operations
- REST API → Job scheduler: queues node
- REST API → Node inventory: reloads inventory
- REST API → Device node: fetches configuration
- Network devices → Syslog helper: signals changes
- Syslog helper → REST client: requests node queue (evidence: `extra/syslog.rb`)
