How openchami/magellan works
Magellan is a Go CLI for discovering BMCs and collecting Redfish inventory, with additional commands for PDU inventory, firmware updates, and power control. The main workflow takes target or cached scan data, maps BMC identifiers, connects to Redfish, gathers inventory, and emits structured data for files or SMD. The graph includes major README capabilities, but excerpts are partial; uncertain command wiring and the unlisted secrets implementation are not expanded.
Main entry points: root.go Command router · pkg/collect.go Inventory collection · cmd/collect.go Collect command · scan.go Network scan
Components 22
CLI workflows
- Command router
cmd/root.go - Scan command
cmd/scan.go - Collect command
cmd/collect.go - PDU collect
cmd/pdu-collect.go - Update command
cmd/update.go - Power command
cmd/power.go
Discovery and inventory
- Network scan
pkg/scan.go - Inventory collection
pkg/collect.go - Redfish crawler
pkg/crawler/main.go - BMC ID mapping
pkg/idmap/user_provided_mapper.go - PDU inventory
pkg/pdu/pdu-inventory.go - JAWS PDU crawler
pkg/jaws/pdu-crawler.go
External integrations
- BMC Redfish API
- SMD client
pkg/client/smd.go - OpenCHAMI SMD
Local state and output
- Scan cache
internal/cache/cache.go - JSON YAML format
internal/format/format.go - BMC secrets
- Inventory files
Device operations
- Firmware update
pkg/update.go - Power control
pkg/power/power.go
Other components
- Operator
Connections 26
- Operator → Command router: invokes
- Command router → Scan command: dispatches
- Command router → Collect command: dispatches
- Command router → PDU collect: dispatches
- Command router → Update command: dispatches
- Command router → Power command: dispatches
- Scan command → Network scan: runs scan
- Network scan → BMC Redfish API: probes
- Network scan → Scan cache: stores results
- Collect command → Scan cache: loads targets
- Collect command → Inventory collection: collects inventory
- Collect command → BMC secrets: loads credentials
- Inventory collection → BMC ID mapping: maps identifiers
- Inventory collection → Redfish crawler: crawls BMCs
- Redfish crawler → BMC Redfish API: queries Redfish
- Inventory collection → JSON YAML format: formats output
- Inventory collection → Inventory files: writes inventory
- Inventory collection → SMD client: submits inventory
- SMD client → OpenCHAMI SMD: sends data
- PDU collect → PDU inventory: collects PDU data
- PDU inventory → JAWS PDU crawler: uses crawler
- JAWS PDU crawler → BMC Redfish API: queries devices
- Update command → Firmware update: runs update
- Firmware update → BMC Redfish API: updates firmware
- Power command → Power control: controls power
- Power control → BMC Redfish API: reads and resets