NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, a popular infrastructure resource modeling tool used for managing IP addresses, devices, and other network resources. The node allows users to perform various operations on different domains and resources within NetBox.

Specifically, the Module - Get operation retrieves information about a specific module within the DCIM domain of NetBox by its ID. This is useful when you want to fetch detailed data about hardware modules installed in devices managed by NetBox.

Common scenarios:

  • Automating inventory management by fetching module details.
  • Integrating NetBox module data into monitoring or reporting workflows.
  • Synchronizing module information with other systems.

Example:
You might use this node to get the details of a module with ID 123 in the DCIM domain to check its specifications or status before performing maintenance tasks.

Properties

Name Meaning
Domain The domain of the NetBox API to interact with. Options include: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. Default is DCIM.
Resource The specific resource within the selected domain. For DCIM domain, options include Module among others. This property is fixed to "modules" for this operation.
Operation The action to perform on the resource. Here it is "Get" to retrieve a single record.
Module ID The numeric ID of the module to retrieve. Required for the Get operation on the Module resource in the DCIM domain.

Output

The node outputs JSON data representing the retrieved module record from NetBox. The structure corresponds to the module's properties as defined by the NetBox API, typically including fields such as:

  • id: The unique identifier of the module.
  • name: The name of the module.
  • Other module-specific attributes like manufacturer, part number, serial number, etc.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to a NetBox instance via its REST API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The node depends on internal helper functions (from ./helpers/executeOperation) to perform the API call.

Troubleshooting

  • Common issues:

    • Invalid or missing Module ID will cause the API call to fail.
    • Incorrect domain or resource selection may lead to no results or errors.
    • Network connectivity problems or incorrect API credentials will prevent successful execution.
  • Error messages:

    • Errors returned from the NetBox API (e.g., 404 Not Found if the module ID does not exist).
    • Authentication errors if the API key is invalid or missing.
  • Resolutions:

    • Verify that the Module ID is correct and exists in NetBox.
    • Ensure the API credentials are properly set up in n8n.
    • Check network access to the NetBox server.

If "Continue on Fail" is enabled, errors will be returned as JSON output instead of stopping the workflow.

Links and References

Discussion