NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API, a popular infrastructure resource modeling tool used for managing IP addresses, devices, and related data in data centers and networks. Specifically, the "Device Bay Template" resource's "Delete" operation allows users to remove a device bay template record from NetBox.

Use cases include automating cleanup of unused or obsolete device bay templates in your network inventory system, integrating NetBox management into broader automation workflows, or enforcing lifecycle policies on device components.

For example, if you have a workflow that decommissions hardware and wants to ensure associated device bay templates are also removed, this node can be used to delete those templates programmatically by specifying their IDs.

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. Default is DCIM.
Device Bay Template ID The numeric ID of the device bay template to delete. Required when Domain is DCIM and Resource is Device Bay Template.

Note: The provided properties JSON includes multiple "ID" fields for tenancy domain which are not relevant here since the focus is on the Device Bay Template Delete operation under the DCIM domain.

Output

The node outputs an array containing one item representing the result of the delete operation. The json field typically contains confirmation of deletion or any returned metadata from the API call.

If an error occurs and "Continue on Fail" is enabled, the output will contain an object with an error property describing the failure message.

No binary data output is expected from 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.
  • The node depends on an internal helper function (executeOperation) to perform the actual API call based on selected domain, resource, and operation.

Troubleshooting

  • Common issues:

    • Invalid or missing Device Bay Template ID will cause the API to reject the delete request.
    • Incorrect domain or resource selection may lead to unexpected errors or no action.
    • Network connectivity or authentication failures will prevent successful API calls.
  • Error messages:

    • Errors thrown during execution are logged and, if "Continue on Fail" is off, will stop the workflow.
    • If "Continue on Fail" is on, errors are returned as part of the output JSON with an error message.
  • Resolution tips:

    • Verify the Device Bay Template ID exists in NetBox before attempting deletion.
    • Ensure the API key credential has sufficient permissions to delete resources.
    • Check network access and endpoint URL correctness in the credential configuration.

Links and References

Discussion