NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, specifically targeting the "Module Bay" resource within the "DCIM" domain for the "Create" operation. It allows users to create a new module bay associated with a device in their NetBox instance. This is useful in scenarios where network or data center administrators want to programmatically add module bays to devices for inventory management, automation, or integration workflows.

Practical examples:

  • Automatically adding module bays when provisioning new hardware devices.
  • Integrating with other systems to keep NetBox updated with physical device configurations.
  • Bulk creation of module bays based on external data sources.

Properties

Name Meaning
Domain The domain of the NetBox API to interact with. Options: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. For this operation, must be "DCIM".
Device ID Numeric ID of the device to which the module bay will be added.
Name Optional name of the module bay being created.
Additional Fields A collection of optional fields to provide more details about the module bay:
- Installed Module ID Numeric ID of an installed module to associate with the bay.
- Label Label text for the module bay.
- Position Position description of the module bay.
- Description Text description of the module bay.
- Tags Comma-separated list of tag IDs to assign to the module bay.
- Custom Fields JSON string representing custom fields for the module bay.

Output

The node outputs a JSON object representing the newly created module bay as returned by the NetBox API. This typically includes all properties of the module bay such as its ID, name, device association, and any additional metadata provided during creation.

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 access to a NetBox instance with API enabled.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • The node relies on an internal helper function to execute the API operation (not detailed here).

Troubleshooting

  • Common issues:

    • Invalid or missing device ID can cause creation failure.
    • Incorrect domain or resource selection may lead to unsupported operations.
    • Malformed JSON in custom fields can cause errors.
    • Network connectivity or authentication failures with the NetBox API.
  • Error messages:

    • Errors from the NetBox API will be surfaced in the node's output if "Continue on Fail" is enabled.
    • Typical errors include validation errors for required fields or permission denied due to invalid credentials.
  • Resolutions:

    • Verify that the device ID exists in NetBox.
    • Ensure the API token has sufficient permissions.
    • Validate JSON syntax for custom fields.
    • Check network connectivity and endpoint URL configuration.

Links and References

Discussion