{"id":44525192,"url":"https://github.com/netdevops/hier-config-api","last_synced_at":"2026-02-13T17:58:37.585Z","repository":{"id":334631971,"uuid":"889233303","full_name":"netdevops/hier-config-api","owner":"netdevops","description":"Hierarchical Configuration Rest API","archived":false,"fork":false,"pushed_at":"2026-02-06T03:35:59.000Z","size":884,"stargazers_count":0,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-06T12:53:19.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netdevops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-15T21:45:16.000Z","updated_at":"2026-02-06T03:35:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/netdevops/hier-config-api","commit_stats":null,"previous_names":["netdevops/hier-config-api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/netdevops/hier-config-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netdevops%2Fhier-config-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netdevops%2Fhier-config-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netdevops%2Fhier-config-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netdevops%2Fhier-config-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netdevops","download_url":"https://codeload.github.com/netdevops/hier-config-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netdevops%2Fhier-config-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29414277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-13T17:58:36.851Z","updated_at":"2026-02-13T17:58:37.563Z","avatar_url":"https://github.com/netdevops.png","language":"Python","readme":"# hier-config-api\n\n[![CI](https://github.com/netdevops/hier-config-api/workflows/CI/badge.svg)](https://github.com/netdevops/hier-config-api/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/netdevops/hier-config-api/branch/main/graph/badge.svg)](https://codecov.io/gh/netdevops/hier-config-api)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)\n\nREST API for [hier_config](https://github.com/netdevops/hier_config) network configuration management.\n\n## Overview\n\nThis FastAPI-based REST API provides a comprehensive interface to the hier_config library, enabling network engineers to:\n- Compare and diff network configurations\n- Generate remediation and rollback commands\n- Analyze configuration changes across multiple devices\n- Validate configurations for different network platforms\n\n## Features\n\n- **Configuration Operations**: Parse, compare, merge, and search network configurations\n- **Remediation Workflows**: Generate remediation and rollback configurations with tag-based filtering\n- **Multi-Device Reporting**: Aggregate and analyze configuration changes across device fleets\n- **Platform Support**: Cisco IOS, Cisco NX-OS, Cisco IOS-XR, Juniper Junos, Arista EOS\n- **Batch Processing**: Process multiple devices in parallel\n- **Export Formats**: JSON, CSV, YAML\n\n## Quick Start\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/netdevops/hier-config-api.git\ncd hier-config-api\n\n# Install dependencies with poetry\npoetry install\n\n# Run the API server\npoetry run uvicorn hier_config_api.main:app --reload\n```\n\n### Access the API Documentation\n\nOnce the server is running, access the interactive API documentation at:\n- Swagger UI: http://localhost:8000/api/docs\n- ReDoc: http://localhost:8000/api/redoc\n\n## API Endpoints\n\n### Configuration Operations\n\n#### Parse Configuration\n```bash\nPOST /api/v1/configs/parse\n```\nParse raw configuration text into structured format.\n\n**Example:**\n```bash\ncurl -X POST http://localhost:8000/api/v1/configs/parse \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"platform\": \"cisco_ios\",\n    \"config_text\": \"hostname router1\\ninterface GigabitEthernet0/0\\n ip address 192.168.1.1 255.255.255.0\"\n  }'\n```\n\n#### Compare Configurations\n```bash\nPOST /api/v1/configs/compare\n```\nCompare running and intended configurations to show differences.\n\n**Example:**\n```bash\ncurl -X POST http://localhost:8000/api/v1/configs/compare \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"platform\": \"cisco_ios\",\n    \"running_config\": \"hostname old-router\",\n    \"intended_config\": \"hostname new-router\"\n  }'\n```\n\n#### Predict Future Configuration\n```bash\nPOST /api/v1/configs/predict\n```\nPredict configuration state after applying commands.\n\n#### Merge Configurations\n```bash\nPOST /api/v1/configs/merge\n```\nMerge multiple configuration snippets into one.\n\n#### Search Configuration\n```bash\nPOST /api/v1/configs/search\n```\nSearch configuration using pattern matching.\n\n### Remediation Workflows\n\n#### Generate Remediation\n```bash\nPOST /api/v1/remediation/generate\n```\nGenerate remediation and rollback configurations.\n\n**Example:**\n```bash\ncurl -X POST http://localhost:8000/api/v1/remediation/generate \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"platform\": \"cisco_ios\",\n    \"running_config\": \"hostname router1\\ninterface GigabitEthernet0/0\\n ip address 192.168.1.1 255.255.255.0\",\n    \"intended_config\": \"hostname router2\\ninterface GigabitEthernet0/0\\n ip address 192.168.1.2 255.255.255.0\"\n  }'\n```\n\n**Response:**\n```json\n{\n  \"remediation_id\": \"abc-123\",\n  \"platform\": \"cisco_ios\",\n  \"remediation_config\": \"no hostname router1\\nhostname router2\\ninterface GigabitEthernet0/0\\n no ip address 192.168.1.1 255.255.255.0\\n ip address 192.168.1.2 255.255.255.0\",\n  \"rollback_config\": \"...\",\n  \"summary\": {\n    \"additions\": 3,\n    \"deletions\": 2,\n    \"modifications\": 0\n  },\n  \"tags\": {}\n}\n```\n\n#### Apply Tags to Remediation\n```bash\nPOST /api/v1/remediation/{remediation_id}/tags\n```\nApply tag rules to an existing remediation.\n\n#### Filter Remediation by Tags\n```bash\nGET /api/v1/remediation/{remediation_id}/filter?include_tags=safe\u0026exclude_tags=risky\n```\nFilter remediation commands by tags.\n\n### Multi-Device Reporting\n\n#### Create Report\n```bash\nPOST /api/v1/reports\n```\nCreate a multi-device configuration report.\n\n**Example:**\n```bash\ncurl -X POST http://localhost:8000/api/v1/reports \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"remediations\": [\n      {\n        \"device_id\": \"router1\",\n        \"platform\": \"cisco_ios\",\n        \"running_config\": \"...\",\n        \"intended_config\": \"...\"\n      },\n      {\n        \"device_id\": \"router2\",\n        \"platform\": \"cisco_ios\",\n        \"running_config\": \"...\",\n        \"intended_config\": \"...\"\n      }\n    ]\n  }'\n```\n\n#### Get Report Summary\n```bash\nGET /api/v1/reports/{report_id}/summary\n```\nGet aggregated statistics for a report.\n\n#### Get Report Changes\n```bash\nGET /api/v1/reports/{report_id}/changes?tag=safe\u0026min_devices=2\n```\nGet detailed change analysis showing which changes appear across multiple devices.\n\n#### Export Report\n```bash\nGET /api/v1/reports/{report_id}/export?format=json|csv|yaml\n```\nExport report in specified format.\n\n### Platform Information\n\n#### List Platforms\n```bash\nGET /api/v1/platforms\n```\nList all supported network platforms.\n\n#### Get Platform Rules\n```bash\nGET /api/v1/platforms/{platform}/rules\n```\nGet platform-specific configuration rules.\n\n#### Validate Configuration\n```bash\nPOST /api/v1/platforms/{platform}/validate\n```\nValidate configuration for a specific platform.\n\n### Batch Operations\n\n#### Create Batch Job\n```bash\nPOST /api/v1/batch/remediation\n```\nCreate a batch remediation job for multiple devices.\n\n#### Get Batch Job Status\n```bash\nGET /api/v1/batch/jobs/{job_id}\n```\nGet the status and progress of a batch job.\n\n#### Get Batch Job Results\n```bash\nGET /api/v1/batch/jobs/{job_id}/results\n```\nGet the results of a completed batch job.\n\n## Development\n\n### Running Tests\n\n```bash\n# Run all tests\npoetry run pytest\n\n# Run with coverage\npoetry run pytest --cov=hier_config_api --cov-report=html\n\n# Run specific test file\npoetry run pytest tests/test_configs.py -v\n```\n\n### Code Quality\n\n```bash\n# Run ruff linter\npoetry run ruff check .\n\n# Run ruff formatter\npoetry run ruff format .\n\n# Run mypy type checker\npoetry run mypy hier_config_api\n\n# Run all linters\npoetry run ruff check . \u0026\u0026 poetry run mypy hier_config_api\n```\n\n## Supported Platforms\n\n- Cisco IOS (`cisco_ios`)\n- Cisco NX-OS (`cisco_nxos`)\n- Cisco IOS-XR (`cisco_iosxr`)\n- Juniper Junos (`juniper_junos`)\n- Arista EOS (`arista_eos`)\n- Generic (`generic`)\n\n## Architecture\n\n```\nhier-config-api/\n├── hier_config_api/\n│   ├── models/          # Pydantic models for request/response validation\n│   ├── routers/         # API endpoint definitions\n│   ├── services/        # Business logic layer\n│   ├── utils/           # Utility functions (storage, etc.)\n│   └── main.py          # FastAPI application entry point\n├── tests/               # Pytest test suite\n└── pyproject.toml       # Project configuration\n```\n\n## License\n\nSee [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Related Projects\n\n- [hier_config](https://github.com/netdevops/hier_config) - The core library powering this API\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetdevops%2Fhier-config-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetdevops%2Fhier-config-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetdevops%2Fhier-config-api/lists"}