Automation · NetBox
Devices
Cheat sheet · https://pcornel.dk/topic.php?topic=5875
Answer
Devices in NetBox represent physical or virtual network hardware with site, rack position, role, platform, device type and status, and are the anchor for interfaces and IP addresses.
Remember
- Devices have site, rack, role, platform, type and status.
- They anchor interfaces and IP addresses.
- Keep status accurate (planned, active, decommissioning).
First checks
curl -s -H 'Authorization: Token <t>' 'https://<netbox>/api/dcim/devices/?site=<site>&status=active' | jq '.count'— active devices- Device role, type, platform — automation fields
- Primary IP set — management access
Verify in this order
device record → inventory/config generation
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5875