NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, specifically allowing users to update a "Module Type" resource within the "DCIM" domain. It is designed to modify existing module type records by specifying their ID and updating various fields such as model name, manufacturer, part number, weight, description, comments, tags, and custom fields.

Typical use cases include:

  • Updating hardware module details in an infrastructure management system.
  • Correcting or enriching metadata about device modules.
  • Automating maintenance tasks that require bulk updates of module types.

For example, you might update the model name and part number of a specific module type after receiving new hardware specifications from a manufacturer.

Properties

Name Meaning
Domain The domain of the NetBox API to interact with. For this operation, it must be "DCIM".
Module Type ID The unique numeric identifier of the module type record to update.
Update Fields A collection of fields to update on the module type:
- Model The model name of the module type.
- Manufacturer ID Numeric ID representing the manufacturer of the module type.
- Part Number The part number associated with the module type.
- Weight The weight value of the module type.
- Weight Unit Unit of measurement for weight; options are Kilograms (kg), Grams (g), Pounds (lb), Ounces (oz).
- Description Textual description of the module type.
- Comments Additional comments about the module type.
- Tags Comma-separated list of tag IDs to associate with the module type.
- Custom Fields JSON string representing any custom fields for the module type.

Output

The node outputs a JSON object representing the updated module type record as returned by the NetBox API. This typically includes all the fields of the module type after the update has been applied.

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 the NetBox API via an API key credential configured in n8n.
  • The node depends on an internal helper function (executeOperation) to perform the actual API call.
  • Proper permissions on the NetBox instance to update module type records are necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing Module Type ID will cause the update to fail.
    • Incorrect or insufficient API credentials can lead to authentication errors.
    • Providing malformed JSON in the "Custom Fields" property may cause parsing errors.
    • Attempting to update fields not allowed by the API or with invalid values may result in validation errors.
  • Error messages:

    • Authentication errors: Check your API key credential and ensure it has proper access rights.
    • Not found errors: Verify the Module Type ID exists in the NetBox instance.
    • Validation errors: Review the fields being updated for correct data types and required formats.
    • Network errors: Ensure connectivity to the NetBox server.

Enabling "Continue on Fail" allows workflows to handle errors gracefully by passing error information downstream.

Links and References

Discussion