NetBox icon

NetBox

Consume NetBox API

Actions243

Device → Create

AI-generated

Overview

This node interacts with the NetBox API to create a new device within the DCIM domain. It is useful for network administrators or IT professionals who want to automate the addition of devices to their network inventory managed by NetBox. For example, it can be used to programmatically add a new network switch or server to a specific site with detailed attributes.

Use Case Examples

  1. Create a new device named 'Switch-01' of a specific device type at a given site with optional fields like status, role, tenant, serial number, and tags.
  2. Automate device inventory updates by integrating this node into workflows that provision new hardware.

Properties

Name Meaning
Domain Specifies the domain of the NetBox API to use, here it is 'dcim' for device management.
Name Name of the device to be created.
Device Type ID ID of the device type to assign to the new device.
Site ID ID of the site where the device will be located.
Additional Fields Optional additional fields for the device such as status, role ID, tenant ID, platform ID, serial number, asset tag, location ID, rack ID, position, face, primary IP addresses, cluster ID, virtual chassis ID, VC position, VC priority, comments, tags, and custom fields.

Output

JSON

  • id - Unique identifier of the created device.
  • name - Name of the created device.
  • device_type_id - ID of the device type assigned.
  • site_id - ID of the site where the device is located.
  • status - Status of the device.
  • role - Role ID of the device.
  • tenant - Tenant ID associated with the device.
  • platform - Platform ID of the device.
  • serial - Serial number of the device.
  • asset_tag - Asset tag of the device.
  • location - Location ID of the device.
  • rack - Rack ID where the device is mounted.
  • position - Position in the rack.
  • face - Mounting face of the device.
  • primary_ip4 - Primary IPv4 address ID.
  • primary_ip6 - Primary IPv6 address ID.
  • cluster - Cluster ID.
  • virtual_chassis - Virtual chassis ID.
  • vc_position - Position in the virtual chassis.
  • vc_priority - Priority in the virtual chassis.
  • comments - Comments about the device.
  • tags - Tags associated with the device.
  • custom_fields - Custom fields in JSON format.

Dependencies

  • NetBox API with appropriate credentials for authentication.

Troubleshooting

  • Common issues include missing required fields such as device_type_id or site_id, which will cause the API call to fail.
  • Invalid domain or resource selection can lead to errors; ensure the domain is set to 'dcim' and resource to 'devices' for device creation.
  • API authentication errors may occur if the API key or credentials are incorrect or missing.
  • If the device name is not unique or violates NetBox constraints, the creation may fail.

Links

Discussion