NetBox icon

NetBox

Consume NetBox API

Actions243

Front Port → Create

AI-generated

Overview

This node interacts with the NetBox API to create a new front port for a device within the DCIM domain. It is useful in network infrastructure management scenarios where users need to programmatically add front ports to devices in NetBox, facilitating automation of network inventory and configuration tasks.

Use Case Examples

  1. Creating a front port for a specific device by specifying its device ID, port name, type, and associated rear port ID.
  2. Adding additional metadata such as module ID, label, color, and custom fields to the front port during creation.

Properties

Name Meaning
Domain Specifies the domain of the NetBox API to use, here it is set to 'dcim' for data center infrastructure management.
Device ID The ID of the device to which the front port belongs.
Name The name of the front port to be created.
Type The physical type of the port connector, such as LC, SC, BNC, etc.
Rear Port ID The ID of the associated rear port to which this front port connects.
Additional Fields Optional additional fields for the front port such as module ID, label, color, mark connected status, rear port position, description, tags, and custom fields.

Output

JSON

  • id - The unique identifier of the created front port.
  • device_id - The device ID to which the front port belongs.
  • name - The name of the front port.
  • type - The physical connector type of the front port.
  • rear_port_id - The ID of the associated rear port.
  • module - Optional module ID if specified.
  • label - Optional physical label of the port.
  • color - Optional color of the port as a hex string.
  • mark_connected - Indicates if the port is marked as connected.
  • rear_port_position - The position of the port on the rear port.
  • description - Description of the front port.
  • tags - Comma-separated tags associated with the front port.
  • custom_fields - Custom fields as a JSON object.

Dependencies

  • NetBox API
  • An API key credential for authentication

Troubleshooting

  • Ensure the device ID and rear port ID exist in NetBox before creating the front port to avoid errors.
  • Verify that the API key credential is valid and has sufficient permissions to create front ports.
  • Common error messages may include authentication failures, invalid device or rear port IDs, or missing required fields. Resolving these involves checking credentials, input values, and required parameters.

Links

Discussion