NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, specifically allowing users to create a "Module" resource within the "DCIM" domain. It is designed to facilitate the management of network infrastructure by automating the creation of hardware modules associated with devices in NetBox. This is useful in scenarios where network engineers or administrators want to programmatically add module information such as module type, serial number, and asset tags to devices, improving inventory accuracy and operational efficiency.

Practical examples include:

  • Automatically adding new hardware modules to devices during provisioning workflows.
  • Synchronizing hardware inventory data from external systems into NetBox.
  • Managing detailed device configurations by specifying module bays and types.

Properties

Name Meaning
Domain The domain of the NetBox API to interact with; for this operation, it must be "DCIM".
Device ID Numeric identifier of the device to which the module will be attached.
Module Bay ID Numeric identifier of the module bay where the module will be installed.
Module Type ID Numeric identifier of the module type being created.
Additional Fields Optional extra details about the module:
- Serial Number Serial number of the module.
- Asset Tag Asset tag assigned to the module.
- Description Text description of the module.
- Comments Any comments related to the module.
- Tags Comma-separated list of tag IDs to categorize the module.
- Custom Fields JSON string representing custom fields for the module.

Output

The node outputs a JSON object representing the response from the NetBox API after creating the module. This typically includes all details of the newly created module resource, such as its unique ID, associated device, module bay, module type, and any additional fields provided.

If an error occurs and "Continue on Fail" is enabled, the output will contain a JSON object with an error field describing the issue.

The node does not output binary data.

Dependencies

  • Requires an active connection to a NetBox instance via an API key credential configured in n8n.
  • The node depends on the NetBox API being accessible and properly authenticated.
  • No other external dependencies are required.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials can cause authentication failures.
    • Providing incorrect device, module bay, or module type IDs will result in API errors.
    • Network connectivity issues to the NetBox server will prevent execution.
    • Malformed JSON in custom fields may cause request failures.
  • Error Messages:

    • Authentication errors indicate invalid or missing API keys; verify credentials.
    • Validation errors from the API usually specify which input field is incorrect; check IDs and required fields.
    • Timeout or network errors suggest connectivity problems; ensure the NetBox server is reachable.
  • Resolution Tips:

    • Double-check all numeric IDs correspond to existing resources in NetBox.
    • Validate JSON syntax for custom fields before submission.
    • Enable "Continue on Fail" to handle errors gracefully within workflows.

Links and References

Discussion