NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API to update a Device Type resource within the DCIM domain. It allows users to modify various attributes of an existing device type, such as its manufacturer, model, physical dimensions, airflow direction, and custom fields. This is useful in network infrastructure management scenarios where device specifications need to be kept current or corrected in the NetBox inventory.

Practical examples include:

  • Updating the model name or part number after receiving new hardware.
  • Adjusting the rack unit height or depth status when physical form factors change.
  • Adding or modifying tags and comments for better categorization and documentation.
  • Changing the airflow direction to reflect actual device cooling characteristics.

Properties

Name Meaning
Domain The NetBox API domain to use; here it must be "DCIM" for device types.
Device Type ID The unique identifier of the device type record to update.
Update Fields A collection of fields to update on the device type, including:
- Manufacturer ID Numeric ID of the manufacturer associated with the device type.
- Model Model name string of the device type.
- Slug Unique URL-friendly identifier string for the device type.
- Part Number Manufacturer's part number string.
- Height (U) Numeric height in rack units (U).
- Is Full Depth Boolean indicating if the device consumes both front and rear rack faces.
- Subdevice Role Parent/child role in rack; options are None, Parent, or Child.
- Airflow Airflow direction; options include Front to Rear, Rear to Front, Left to Right, Right to Left, Side to Rear, Passive, Mixed.
- Weight Numeric weight of the device type.
- Weight Unit Unit of weight; options are Kilograms, Grams, Pounds, Ounces.
- Comments Free text comments about the device type.
- Tags Comma-separated list of tags for categorization.
- Custom Fields JSON object containing any custom fields defined for the device type.

Output

The node outputs a JSON object representing the updated device type record as returned by the NetBox API. This typically includes all the fields of the device type after the update operation 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.

No binary data output is involved.

Dependencies

  • Requires access to a NetBox instance with the appropriate API endpoint.
  • Requires an API authentication token credential configured in n8n to authorize requests to the NetBox API.
  • The node depends on internal helper functions to execute the API operation but no external npm packages beyond those bundled.

Troubleshooting

  • Common issues:
    • Invalid or missing Device Type ID will cause the update to fail.
    • Insufficient permissions or invalid API token can result in authorization errors.
    • Providing invalid values for fields (e.g., negative height, unknown airflow option) may cause API validation errors.
  • Error messages:
    • Errors from the NetBox API will be surfaced as error messages in the node execution logs.
    • If "Continue on Fail" is enabled, errors will be returned as JSON output with an error message.
  • Resolution tips:
    • Verify the Device Type ID exists in NetBox before updating.
    • Ensure the API token has write permissions for the DCIM domain.
    • Validate input fields against allowed values and formats.

Links and References

Discussion