Layer Stack

Overview

netapi uses a five-layer composable architecture where each layer builds on the one below:

Layer Stack

Layer Details

1. Primitives (Foundation)

The atomic building blocks that everything else composes:

Module Purpose

auth

Authentication helpers (Basic, Bearer, Certificate)

http

HTTP client abstractions (sync/async)

parsers

Response parsing (XML, JSON, CLI output)

models

Pydantic models for type safety

utils

Common utilities (MAC formatting, date parsing)

2. Protocols (Transport)

Network protocol implementations:

Protocol Port Use Case

RESTCONF

443

Modern REST for Cisco IOS-XE

NETCONF

830

Configuration management

gNMI

9339

Streaming telemetry

SSH

22

CLI automation

SNMP

161

Monitoring/polling

3. Capabilities (Actions)

Vendor-agnostic operations:

  • Backup - Configuration backup to NAS

  • Monitoring - Health checks, session queries

  • Provisioning - Device configuration

  • Compliance - Policy validation

4. Vendors (Implementation)

Platform-specific implementations:

Vendor APIs Status

Cisco ISE

ERS, MnT, DataConnect, pxGrid

✓ Active

Cisco IOS

SSH, RESTCONF

Planned

pfSense

REST API

Partial

Synology

DSM API

Planned

5. Workflows (Orchestration)

Multi-step operations combining multiple vendors:

  • multi-vendor-backup - Backup ISE + pfSense + switches

  • device-inventory - Collect inventory from all devices

  • compliance-audit - Validate configuration standards

Directory Structure

netapi/
├── netapi/
│   ├── cli/
│   │   ├── ise.py              # ISE CLI commands
│   │   └── docs.py             # Docs scraper CLI
│   ├── primitives/
│   │   ├── auth/
│   │   ├── http/
│   │   ├── parsers/
│   │   └── models/
│   ├── protocols/
│   │   ├── restconf/
│   │   ├── netconf/
│   │   └── ssh/
│   ├── capabilities/
│   │   ├── backup/
│   │   └── monitoring/
│   └── vendors/
│       ├── cisco/
│       │   └── ise/
│       ├── pfsense/
│       └── synology/
├── pyproject.toml
└── README.md