How brennoo/terraform-provider-hrui works
Key Components
a) Provider Configuration
┌─ Provider Configuration ─┐
• URL │
• Username │
• Password │
• ┘
b) Resource Management System
┌─ Resource Manager ──────┐
• ┌─ Resources ─────────┐│
• Port Settings ││
• VLAN ││
• QoS ││
• MAC ││
• ┘││
• ┘
c) Data Source System
┌─ Data Sources ─────────┐
• System Info │
• Port Statistics │
• MAC Table │
• ┘
d) SDK Layer
┌─ SDK Layer ───────────┐
• HTTP Client │
• HTML Parsing │
• Form Submission │
• ┘
Flow Directions
• Configuration flow from Terraform to the provider
• CRUD operations flow through the resource system
• Data retrieval flow through the data sources
• Communication flow between SDK and switch web UI
Component Relationships
Clear relationships between:
• Provider configuration and SDK client initialization
• Resource implementations and their corresponding SDK functions
• Data sources and their SDK query methods
Technical Details
• goquery integration points
• HTTP client configuration
• Resource state management
• Validation and error handling paths
┌─ Terraform ──────────────────────────────────────┐
• ┌─ Provider Configuration ─┐ │
• (hrui) │ │
• ┬──────────┘ │
• ▼ │
• ┌─ Provider Core ────────────────────────┐ │
• ┌─ Resources ─┐ ┌─ Data Sources ─┐ │ │
• VLAN │ │ System Info │ │ │
• QoS │ │ Statistics │ │ │
• Port Config │ │ MAC Table │ │ │
• ┘ └───────────────┘ │ │
• ┬────────────────────┘ │
• ▼ │
• ┌─ SDK Layer ────────────────────────────┐ │
• HTTP Client | HTML Parser | Form Handler│ │
• ┬────────────────────────┘ │
• ┘
• ▼
┌─ HRUI Switch Web Interface ─┐
• (External System) │
• ┘
Remember to:
• Use consistent styling
• Brief annotations for complex interactions
• Document any assumptions or limitations