NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API, specifically targeting the "Virtual Chassis" resource within the "DCIM" domain for the Update operation. It allows users to update existing virtual chassis records by specifying their ID and providing new values for various fields.

Typical use cases include:

  • Renaming a virtual chassis.
  • Changing the master device of a virtual chassis.
  • Adding or updating descriptions, comments, tags, or custom fields associated with a virtual chassis.

For example, you might use this node to update the name and description of a virtual chassis after hardware changes or to add tags for better categorization.

Properties

Name Meaning
Domain The domain of the NetBox API to target. Options: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. For this operation, must be "DCIM".
Virtual Chassis ID The unique numeric identifier of the virtual chassis record to update.
Update Fields A collection of fields to update on the virtual chassis:
- Name New name for the virtual chassis (string).
- Domain New domain name (string, max 30 characters).
- Master Device ID ID of the device to set as the master in the virtual chassis (number).
- Description Text description of the virtual chassis (string).
- Comments Additional comments about the virtual chassis (string).
- Tags Comma-separated list of tag IDs to associate with the virtual chassis (string).
- Custom Fields JSON string representing custom fields to update on the virtual chassis.

Output

The node outputs an array containing one item per execution, where each item has a json property holding the updated virtual chassis data returned from the NetBox API. This typically includes all fields of the virtual chassis record after the update.

No binary data output is produced by this node.

Dependencies

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

Troubleshooting

  • Common issues:

    • Providing an invalid or non-existent Virtual Chassis ID will result in an error from the API.
    • Incorrectly formatted custom fields JSON may cause the update to fail.
    • Missing required fields such as the Virtual Chassis ID or Domain will prevent execution.
    • Network connectivity issues or incorrect API credentials will cause authentication or connection errors.
  • Error messages:

    • Errors from the NetBox API are passed through; typical messages include "Not Found" for invalid IDs or "Unauthorized" for bad credentials.
    • If the node fails, it logs the error and, if "Continue On Fail" is enabled, returns the error message in the output JSON under error.
  • Resolution tips:

    • Verify the Virtual Chassis ID exists in your NetBox instance.
    • Ensure the API token has sufficient permissions to update virtual chassis records.
    • Validate JSON syntax for custom fields before input.
    • Check network access and endpoint URL correctness.

Links and References

Discussion