Add comprehensive REST API for hier_config network configuration management #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a complete REST API implementation for the hier_config library, enabling network engineers to programmatically compare, analyze, and remediate network configurations across multiple devices and platforms.
Key Changes
FastAPI Application: Created a production-ready FastAPI application with proper middleware configuration (CORS), health checks, and API documentation endpoints
Comprehensive API Endpoints: Implemented 20+ REST endpoints organized into 5 logical routers:
Data Models: Created Pydantic models for all request/response types with comprehensive field documentation and validation
Service Layer: Implemented business logic services that wrap hier_config library functionality:
ConfigService: Handles configuration parsing, comparison, merging, and searchingRemediationService: Manages remediation generation and tag-based filteringReportService: Aggregates multi-device changes and exports in multiple formatsPlatformService: Provides platform information and batch job processingStorage Abstraction: Added a storage utility layer for persisting remediation data, reports, and batch jobs
Documentation: Comprehensive README with:
Notable Implementation Details
/api/docs(Swagger UI) and/api/redocTesting & Quality