Skip to content

feat: import device type from NetBox YAML #259

@ggfevans

Description

@ggfevans

Parent Epic

Part of #71 (Network Interface Visualization and Connectivity)

Summary

Allow users to import device types from NetBox devicetype-library YAML format.

Acceptance Criteria

  • Parse NetBox device-type YAML format
  • Map NetBox fields to Rackula schema
  • Handle missing fields (add required Rackula fields: colour, category)
  • Import interfaces array
  • Import console-ports, power-ports (mapped to appropriate types)
  • Validate imported data against Zod schema
  • Show import preview before applying
  • Handle import errors gracefully

Import Methods

  1. Paste YAML - Text area for pasting YAML content
  2. Upload file - File picker for .yaml/.yml files
  3. URL import (future) - Fetch from GitHub raw URL

Field Mapping

NetBox Field Rackula Field Notes
manufacturer manufacturer Direct
model model Direct
slug slug Direct
u_height u_height Direct
is_full_depth is_full_depth Direct
interfaces interfaces Map type field
- colour User must select
- category Infer or user select

UI Design

┌─────────────────────────────────┐
│ Import from NetBox YAML         │
├─────────────────────────────────┤
│ ○ Paste YAML  ○ Upload File     │
│                                 │
│ ┌─────────────────────────────┐ │
│ │manufacturer: Cisco          │ │
│ │model: C9300-48P             │ │
│ │...                          │ │
│ └─────────────────────────────┘ │
│                                 │
│ [Parse]                         │
│                                 │
│ Preview:                        │
│ ┌─────────────────────────────┐ │
│ │ Cisco C9300-48P             │ │
│ │ 1U, 48 interfaces           │ │
│ │ Category: [Network ▼]       │ │
│ │ Color: [■ Pick color]       │ │
│ └─────────────────────────────┘ │
│                                 │
│ [Cancel]              [Import]  │
└─────────────────────────────────┘

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions