# paloaltonetworks/pan-os-python architecture

> Architecture diagram of the GitHub repository paloaltonetworks/pan-os-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paloaltonetworks/pan-os-python
- Repository: https://github.com/paloaltonetworks/pan-os-python

## Overview

pan-os-python is an object-oriented SDK for configuring and operating PAN-OS firewalls and Panorama. The primary workflow is for an engineer to construct a configuration tree, apply object changes, and commit them, or issue operational commands and refresh device state. The modules cover device and Panorama management, configuration domains, HA, plugins, software updates, and User-ID. The README documents the workflow; source excerpts are partial, so unshown subsystem call relationships are not inferred.

Main entry points: [`panos/base.py`](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/base.py) (Config tree), [`panos/firewall.py`](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/firewall.py) (Firewall), [`panos/device.py`](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/device.py) (Device API), [`panos/panorama.py`](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/panorama.py) (Panorama)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Device management"]
  node_firewall["Firewall<br/>[firewall.py]"]
  node_panorama["Panorama<br/>[panorama.py]"]
  node_device["Device API<br/>[device.py]"]
end

subgraph group_config["Configuration model"]
  node_base["Config tree<br/>[base.py]"]
  node_network["Network config<br/>[network.py]"]
  node_objects["Objects<br/>[objects.py]"]
  node_policies["Policies<br/>[policies.py]"]
  node_predefined["Predefined config<br/>[predefined.py]"]
end

subgraph group_features["Device features"]
  node_ha["High availability<br/>[ha.py]"]
  node_plugins["Cloud plugins<br/>[plugins.py]"]
  node_updater["Software updater<br/>[updater.py]"]
  node_userid["User-ID<br/>[userid.py]"]
end

subgraph group_support["SDK support"]
  node_errors["API errors<br/>[errors.py]"]
end

node_engineer(("SDK user"))
node_panos_device(("PAN-OS device"))

node_engineer -->|"creates"| node_firewall
node_engineer -->|"models interface"| node_network
node_engineer -->|"builds tree"| node_base
node_engineer -->|"runs operations"| node_device
node_firewall -.->|"connects to"| node_panos_device
node_device -.->|"sends commands"| node_panos_device
node_base -->|"applies changes"| node_panos_device
node_base -->|"reads configuration"| node_panos_device
node_engineer -->|"manages"| node_panorama

click node_firewall "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/firewall.py"
click node_panorama "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/panorama.py"
click node_device "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/device.py"
click node_base "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/base.py"
click node_network "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/network.py"
click node_objects "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/objects.py"
click node_policies "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/policies.py"
click node_predefined "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/predefined.py"
click node_ha "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/ha.py"
click node_plugins "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/plugins.py"
click node_updater "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/updater.py"
click node_userid "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/userid.py"
click node_errors "https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/errors.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_firewall,node_panorama,node_device,node_engineer toneBlue
class node_base,node_network,node_objects,node_policies,node_predefined toneAmber
class node_ha,node_plugins,node_updater,node_userid toneMint
class node_errors toneRose
class node_panos_device toneIndigo
```

## Components

### Device management

- [Firewall](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/firewall.py): `panos/firewall.py`
- [Panorama](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/panorama.py): `panos/panorama.py`
- [Device API](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/device.py): `panos/device.py`

### Configuration model

- [Config tree](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/base.py): `panos/base.py`
- [Network config](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/network.py): `panos/network.py`
- [Objects](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/objects.py): `panos/objects.py`
- [Policies](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/policies.py): `panos/policies.py`
- [Predefined config](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/predefined.py): `panos/predefined.py`

### Device features

- [High availability](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/ha.py): `panos/ha.py`
- [Cloud plugins](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/plugins.py): `panos/plugins.py`
- [Software updater](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/updater.py): `panos/updater.py`
- [User-ID](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/userid.py): `panos/userid.py`

### SDK support

- [API errors](https://github.com/paloaltonetworks/pan-os-python/blob/develop/panos/errors.py): `panos/errors.py`

### Other components

- **SDK user**
- **PAN-OS device**

## Connections

- SDK user → Firewall: creates (evidence: `README.md`)
- SDK user → Network config: models interface (evidence: `README.md`)
- SDK user → Config tree: builds tree (evidence: `README.md`)
- SDK user → Device API: runs operations (evidence: `README.md`)
- Firewall → PAN-OS device: connects to (evidence: `README.md`)
- Device API → PAN-OS device: sends commands (evidence: `README.md`)
- Config tree → PAN-OS device: applies changes (evidence: `panos/base.py`)
- Config tree → PAN-OS device: reads configuration (evidence: `panos/base.py`)
- SDK user → Panorama: manages (evidence: `README.md`)
