NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API, specifically targeting the "Region" resource within the "DCIM" domain to list regions. It allows users to retrieve a collection of region records from their NetBox instance, optionally filtered and limited according to user-defined criteria.

Common scenarios for this node include:

  • Fetching all or a subset of geographical or logical regions defined in NetBox for inventory or reporting purposes.
  • Integrating region data into workflows that require location-based filtering or organization of network assets.
  • Automating synchronization of region information between NetBox and other systems.

For example, a user might use this node to list all regions with a specific tag or parent region, then process or visualize this data downstream in an automation workflow.

Properties

Name Meaning
Domain The domain of the NetBox API to target. For this operation, it must be set to DCIM.
Return All Whether to return all matching results or limit the output. If true, all results are returned; if false, results are limited by the "Limit" property.
Limit The maximum number of region records to return when "Return All" is false. Must be at least 1.
Filters Optional filters to narrow down the list of regions. Available filters include:
• Region ID (number)
• Name (string)
• Slug (string)
• Description (string)
• Parent Region ID (number)
• Parent Region Name (slug string)
• Tag (string)

Output

The node outputs JSON data representing the list of regions retrieved from NetBox. Each item in the output array corresponds to a region object as defined by the NetBox API, including fields such as ID, name, slug, description, parent region, and tags.

No binary data output is produced by this node.

Example structure of one region item in the output JSON might look like:

{
  "id": 1,
  "name": "North America",
  "slug": "north-america",
  "description": "Region covering North American sites",
  "parent": null,
  "tags": ["continent", "priority"]
}

Dependencies

  • Requires access to a NetBox instance with the API enabled.
  • Requires an API authentication token credential configured in n8n to authenticate requests to NetBox.
  • The node depends on internal helper functions to execute the API operation but no external npm packages beyond those bundled with n8n.

Troubleshooting

  • Common issues:

    • Authentication failures due to missing or invalid API tokens.
    • Network connectivity problems preventing access to the NetBox API endpoint.
    • Incorrect filter values causing empty result sets.
    • Exceeding API rate limits if requesting too many records without pagination.
  • Error messages:

    • Errors thrown during execution will be logged to the console.
    • If "Continue On Fail" is enabled, errors will be returned as part of the node output JSON under an error field.
    • Typical error messages may include HTTP status codes indicating unauthorized access, not found resources, or bad request parameters.
  • Resolutions:

    • Verify API credentials and permissions.
    • Check network connectivity and API URL correctness.
    • Adjust filters and limits to valid values.
    • Enable "Return All" cautiously to avoid large data loads.

Links and References

Discussion