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. Specifically, the "Module" resource's "Update" operation allows users to modify existing module records within the DCIM domain of NetBox.

Typical use cases include updating hardware module details such as serial numbers, asset tags, descriptions, or associating modules with different devices or bays. For example, when a physical module is replaced or reconfigured in a data center, this node can update the corresponding record in NetBox to keep the inventory accurate.

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".
Module ID Numeric ID of the module to update.
Update Fields Collection of fields to update on the module:
- Device ID Numeric ID of the device the module belongs to.
- Module Bay ID Numeric ID of the module bay where the module is installed.
- Module Type ID Numeric ID representing the type of the module.
- Serial Number Serial number string of the module.
- Asset Tag Asset tag string associated with the module.
- Description Text description of the module.
- Comments Additional comments about the module.
- Tags Comma-separated list of tag IDs to associate with the module.
- Custom Fields JSON string representing custom fields for the module.

Output

The node outputs the updated module record as a JSON object in the json output field. This object reflects the current state of the module after the update operation, including any fields that were modified.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to a NetBox instance via its REST API.
  • Requires an API authentication token credential configured in n8n to authorize requests to NetBox.
  • The node depends on an internal helper function (executeOperation) to perform the actual API call.

Troubleshooting

  • Common Issues:

    • Invalid or missing Module ID will cause the update to fail.
    • Providing malformed JSON in the "Custom Fields" property may result in errors.
    • Insufficient permissions or invalid API token can lead to authorization errors.
    • Attempting to update fields not allowed by NetBox or providing invalid field values may cause API errors.
  • Error Messages:

    • Errors from the NetBox API are caught and returned as error messages in the output if "Continue on Fail" is enabled.
    • Typical error messages include "Not Found" (invalid Module ID), "Unauthorized" (bad API token), or validation errors for incorrect field formats.
  • Resolution Tips:

    • Verify the Module ID exists in NetBox before attempting updates.
    • Ensure the API token has write permissions for the DCIM domain.
    • Validate JSON syntax for custom fields.
    • Use the NetBox UI or API documentation to confirm valid field values.

Links and References

Discussion