NetBox icon

NetBox

Consume NetBox API

Overview

This node interacts with the NetBox API, a popular infrastructure resource modeling tool. Specifically, for the "Module Type" resource with the "Delete" operation, it deletes a specified module type record from the NetBox system. This is useful in scenarios where you need to programmatically remove obsolete or incorrect module types from your inventory management.

Practical examples include:

  • Automating cleanup of module types that are no longer used.
  • Integrating with CI/CD pipelines to maintain an up-to-date hardware inventory.
  • Removing test or temporary module types created during development or testing phases.

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".
Module Type ID The numeric ID of the module type record to delete. Required to identify which module type to remove.

Output

The output JSON contains the result of the delete operation. Typically, a successful deletion returns an empty object or confirmation message depending on the API response. If an error occurs, the output will contain an error field with the error message.

No binary data output is expected for this operation.

Example success output:

{}

Example error output (if "Continue on Fail" is enabled):

{
  "error": "Error message describing what went wrong"
}

Dependencies

  • Requires an active 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 internal helper functions to execute the API operation but does not require external npm packages beyond those bundled.

Troubleshooting

  • Common issues:

    • Invalid or missing Module Type ID: Ensure the ID provided corresponds to an existing module type.
    • Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
    • Network connectivity problems: Confirm that the NetBox server is reachable from the n8n environment.
  • Common error messages:

    • "404 Not Found": The specified Module Type ID does not exist.
    • "401 Unauthorized" or "403 Forbidden": Authentication failed or insufficient permissions.
    • "400 Bad Request": The request parameters are invalid or incomplete.
  • Resolutions:

    • Double-check the Module Type ID input.
    • Reconfigure or update the API authentication credentials.
    • Check network settings and firewall rules.

Links and References

Discussion