NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, a popular infrastructure resource modeling tool. Specifically, for the Virtual Device Context resource and the Delete operation, it allows users to delete a virtual device context record from their NetBox instance by specifying its unique identifier.

Typical use cases include:

  • Automating cleanup of obsolete or decommissioned virtual device contexts.
  • Integrating NetBox management into broader automation workflows where virtual device contexts need to be programmatically removed.
  • Maintaining an up-to-date inventory by removing stale entries without manual intervention.

Example: A network engineer can set up an automated workflow that deletes virtual device contexts once associated devices are retired, ensuring the NetBox database remains accurate.

Properties

Name Meaning
Domain The domain of the NetBox API to target. Options include: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. For this operation, "dcim" is relevant.
Virtual Device Context ID The numeric ID of the virtual device context record to delete in the NetBox system. This uniquely identifies which virtual device context will be removed.

Output

The node outputs JSON data representing the result of the delete operation. Typically, this will be confirmation of deletion or an error message if the operation failed.

  • json: Contains the response from the NetBox API after attempting to delete the specified virtual device context.
  • No binary data output is expected for this operation.

Dependencies

  • Requires connection to a NetBox instance via its REST API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests to NetBox.
  • The node depends on internal helper functions (from ./helpers/executeOperation) to perform the actual API call.

Troubleshooting

  • Common issues:

    • Invalid or missing Virtual Device Context ID: Ensure the ID provided exists and is correct.
    • Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
    • Network connectivity problems: Confirm that the NetBox API endpoint is reachable from the n8n environment.
  • Error messages:

    • If the node throws an error related to the ID not found, check that the virtual device context ID exists in NetBox.
    • Authentication failures typically indicate invalid or expired API tokens; reconfigure credentials accordingly.
    • If the node returns an error but "Continue on Fail" is enabled, the error will be returned as part of the output JSON under an error field.

Links and References

Discussion