NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API, specifically targeting the "Module Bay" resource within the "DCIM" domain to list module bays. It retrieves a collection of module bay records from NetBox, optionally filtered and limited by user-defined criteria.

Common scenarios for this node include:

  • Inventory management: Fetching all or specific module bays associated with devices in your data center.
  • Automation workflows: Integrating module bay data into asset tracking or configuration management systems.
  • Reporting: Generating lists of module bays based on device or position filters for auditing or planning.

For example, you might use this node to retrieve all module bays for a particular device or to get a limited number of module bays matching a certain name pattern.

Properties

Name Meaning
Domain The domain of the NetBox API to target; here it is fixed to "DCIM" for Module Bays.
Return All Boolean option to return all results without limit or only up to a specified maximum.
Limit Maximum number of results to return when "Return All" is false (minimum 1, default 50).
Filters Collection of optional filters to narrow down results:
- Module Bay ID Filter results by a specific module bay ID (number).
- Device ID Filter results by a specific device ID (number).
- Name Filter results by module bay name (string).
- Position Filter results by position (string).

Output

The node outputs an array of JSON objects representing module bays retrieved from the NetBox API. Each object corresponds to a module bay and contains its properties as returned by the API, such as IDs, names, positions, and related device information.

If the node encounters an error and "Continue On Fail" is enabled, it outputs a JSON object with an error field containing the error message.

This node does not output binary data.

Dependencies

  • Requires access to a NetBox instance with the API enabled.
  • Needs an API authentication token configured in n8n credentials to authorize requests to the NetBox API.
  • The node relies on internal helper functions to execute the API operation but no external npm packages beyond those bundled are explicitly required.

Troubleshooting

  • Common issues:

    • Authentication failures due to missing or invalid API tokens.
    • Network connectivity problems preventing access to the NetBox API.
    • Incorrect filter values leading to 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 disabled, errors will stop the workflow execution.
    • Enabling "Continue On Fail" returns the error message in the output JSON under the error key, allowing downstream handling.
  • Resolutions:

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

Links and References

Discussion