-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Description
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
- Paste YAML - Text area for pasting YAML content
- Upload file - File picker for .yaml/.yml files
- 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
- feat: expand InterfaceTemplate type and Zod schema #247 (InterfaceTemplate schema)
References
- NetBox devicetype-library: https://github.com/netbox-community/devicetype-library
- Schema research:
docs/research/netbox-interface-cable-schema.md