NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, specifically targeting the "Module Bay Template" resource within the "DCIM" domain. The "Create" operation allows users to create a new module bay template in NetBox. This is useful for network engineers or data center managers who want to automate the provisioning and management of hardware templates representing module bays on devices.

Practical scenarios include:

  • Automating the setup of device templates for consistent hardware configurations.
  • Integrating infrastructure-as-code workflows where device templates are programmatically created or updated.
  • Streamlining inventory management by defining module bays centrally via API.

Properties

Name Meaning
Domain The domain of the NetBox API to interact with. Options include: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. For this operation, "DCIM" is used.
Module Bay Template Name The name of the module bay template to create. Supports substitution with {module} placeholder.
Additional Fields Optional extra fields to specify additional details about the module bay template:
- Device Type ID Numeric ID representing the device type associated with the template.
- Module Type ID Numeric ID representing the module type associated with the template.
- Label Physical label string for the module bay template.
- Position Identifier string used for renaming installed components.
- Description Text description of the module bay template.

Output

The node outputs JSON data representing the response from the NetBox API after creating the module bay template. This typically includes all properties of the newly created resource such as its unique identifier, name, associated device and module types, label, position, and description.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the NetBox API.
  • The node depends on the NetBox instance being accessible via network.
  • No other external services are required.
  • Proper configuration of the API endpoint and authentication credentials within n8n is necessary.

Troubleshooting

  • Common Issues:

    • Authentication failures due to invalid or missing API keys.
    • Incorrect domain or resource selection causing API errors.
    • Missing required fields like the module bay template name.
    • Invalid IDs for device type or module type leading to API rejection.
  • Error Messages:

    • Errors returned from the NetBox API will be logged and can be output if "Continue on Fail" is enabled.
    • Typical error messages may include HTTP 400 (Bad Request) for validation issues or HTTP 401/403 for authentication problems.
  • Resolutions:

    • Verify that the API key credential is correctly set up and has sufficient permissions.
    • Ensure that the domain is set to "dcim" and resource to "module-bay-templates" for this operation.
    • Confirm that required fields are provided and valid.
    • Check network connectivity to the NetBox server.

Links and References

Discussion