NetBox icon

NetBox

Consume NetBox API

Overview

This node integrates with the NetBox API, a popular infrastructure resource modeling tool used for managing IP addresses, devices, racks, and other network resources. The "Get" operation on the "Module Bay" resource allows users to retrieve detailed information about a specific module bay within the DCIM domain of NetBox.

Typical use cases include:

  • Fetching details of a particular module bay in a device chassis for inventory or audit purposes.
  • Integrating NetBox data into automation workflows to dynamically adjust configurations based on hardware modules present.
  • Synchronizing module bay information with other systems such as asset management or monitoring tools.

For example, a user might want to get the status and attributes of a module bay identified by its ID to verify if it is occupied or available before deploying new hardware.

Properties

Name Meaning
Domain The domain of the NetBox API to interact with. Options: DCIM, IPAM, Tenancy, Extras, Virtualization, Circuits, Core, Users, Plugins, VPN, Wireless, Status. For this operation, must be "DCIM".
Resource The type of resource to consume within the selected domain. For this operation, set to "Module Bay".
Operation The action to perform on the resource. Here, "Get" retrieves a single record.
Module Bay ID The unique numeric identifier of the module bay to retrieve. This is required to specify which module bay's details to fetch.

Output

The node outputs JSON data representing the retrieved module bay record from NetBox. This JSON typically includes all properties of the module bay such as its ID, name, description, associated device, position, and status.

If the node encounters an error during execution (e.g., invalid ID, network issues), and "Continue on Fail" is enabled, it returns a JSON object with an error field containing the error message.

No binary data output is involved in this operation.

Dependencies

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

Troubleshooting

  • Common Issues:

    • Invalid or missing Module Bay ID will cause the API to return an error.
    • Incorrect domain or resource selection may lead to no results or errors.
    • Network connectivity problems or incorrect API credentials will prevent successful calls.
  • Error Messages:

    • Errors thrown by the node are logged to the console.
    • If "Continue on Fail" is disabled, the node execution stops on error.
    • If enabled, errors are returned as part of the output JSON under the error key.
  • Resolution Tips:

    • Verify that the Module Bay ID exists in your NetBox instance.
    • Ensure the API credentials are valid and have sufficient permissions.
    • Confirm the domain is set to "DCIM" and resource to "module-bays" for this operation.
    • Check network connectivity to the NetBox server.

Links and References

Discussion