NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API, specifically targeting the "Device" resource within the "DCIM" domain to list devices. It allows users to retrieve a collection of devices from their NetBox instance, optionally filtered by various device attributes such as ID, name, status, role, manufacturer, and more.

Common scenarios where this node is beneficial include:

  • Automating inventory management by fetching up-to-date device lists.
  • Integrating device data into workflows for monitoring or reporting.
  • Filtering devices based on specific criteria to trigger further automation steps.

For example, a user might list all active devices at a particular site or retrieve devices of a certain model or manufacturer to audit hardware usage.

Properties

Name Meaning
Domain The NetBox API domain to use. For this operation, it must be set to DCIM.
Return All Whether to return all matching devices or limit the number of results. If false, the number of results returned is limited by the Limit property.
Limit Maximum number of device results to return when Return All is false. Minimum value is 1.
Filters A collection of optional filters to narrow down the device list:
   Device ID Filter devices by their unique numeric ID.
   Name Filter devices by name (case-insensitive).
   Serial Number Filter devices by serial number.
   Asset Tag Filter devices by asset tag.
   Site ID Filter devices by site ID.
   Site Name Filter devices by site name (slug).
   Status Filter devices by status. Options: Active, Decommissioning, Offline, Planned, Failed, Inventory, Staged.
   Device Role ID Filter devices by device role ID.
   Device Role Filter devices by device role name (slug).
   Tenant ID Filter devices by tenant ID.
   Tenant Name Filter devices by tenant name (slug).
   Device Type ID Filter devices by device type ID.
   Manufacturer ID Filter devices by manufacturer ID.
   Manufacturer Name Filter devices by manufacturer name (slug).
   Model Filter devices by model name (slug).
   Platform ID Filter devices by platform ID.
   Platform Name Filter devices by platform name (slug).
   Has Primary IP Filter devices that have a primary IP address (boolean).
   Region ID Filter devices by region ID.
   Region Name Filter devices by region name (slug).
   Tag Filter devices by tag.

Output

The node outputs an array of JSON objects representing devices retrieved from the NetBox API. Each object contains detailed information about a device according to the NetBox schema, including but not limited to identifiers, names, statuses, roles, types, manufacturers, sites, and other metadata.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a NetBox instance with the API enabled.
  • Requires an API authentication token credential configured in n8n to authenticate requests to the NetBox API.
  • The node depends on internal helper functions (not fully shown) to execute the API operation.

Troubleshooting

  • Common issues:

    • Authentication failures due to missing or invalid API tokens.
    • Network connectivity problems preventing access to the NetBox API endpoint.
    • Invalid filter values causing the API to reject the request.
    • Exceeding API rate limits if requesting too many devices at once.
  • Error messages:

    • Errors thrown during execution are logged and, if "Continue on Fail" is enabled, returned as part of the node output.
    • Typical error messages may include HTTP errors (401 Unauthorized, 404 Not Found), validation errors for filters, or timeout errors.
  • Resolutions:

    • Verify API credentials and permissions.
    • Check network connectivity and API endpoint URL.
    • Validate filter inputs for correctness and supported values.
    • Use "Return All" judiciously to avoid large data loads.

Links and References

Discussion