# akshaymane920/pyfortimanagerapi architecture

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

- Interactive diagram: https://gitdiagram.com/akshaymane920/pyfortimanagerapi
- Repository: https://github.com/akshaymane920/pyfortimanagerapi

## Overview

pyFortiManagerAPI is a single-module Python wrapper for FortiManager’s JSON-RPC API. A user configures a `FortiManager` instance, invokes its methods for administration or configuration tasks, and receives JSON results from FortiManager. The documented capabilities include ADOMs, policy packages, IPv4/IPv6 address objects and groups; sampled code also exposes policy, script, backup, and DHCP operations. All runtime components reside in one source file. Relationships are limited to documented user operations and sampled JSON-RPC calls; unsampled method details are not inferred.

Main entry points: [`src/pyFortiManagerAPI.py`](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py) (ADOM operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["API client"]
  node_client["FortiManager client"]
end

subgraph group_admin["Administration"]
  node_adoms["ADOM operations"]
  node_packages["Policy packages"]
end

subgraph group_objects["Address configuration"]
  node_addresses["Address objects"]
  node_addressgroups["Address groups"]
end

subgraph group_policy["Policies"]
  node_policies["Firewall policies"]
end

subgraph group_automation["Automation"]
  node_scripts["Scripts"]
  node_backups["Configuration backup"]
  node_dhcp["DHCP operations"]
end

node_user(("API user"))
node_fm{{"FortiManager"}}

node_user -->|"configures"| node_client
node_user -->|"invokes"| node_adoms
node_user -->|"invokes"| node_packages
node_user -->|"invokes"| node_addresses
node_user -->|"invokes"| node_addressgroups
node_adoms -.->|"sends JSON-RPC"| node_fm
node_packages -->|"sends JSON-RPC"| node_fm
node_addresses -->|"sends JSON-RPC"| node_fm
node_addressgroups -->|"sends JSON-RPC"| node_fm
node_policies -->|"sends JSON-RPC"| node_fm
node_scripts -->|"sends JSON-RPC"| node_fm
node_backups -.->|"sends JSON-RPC"| node_fm
node_dhcp -->|"sends JSON-RPC"| node_fm

click node_client "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_adoms "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_packages "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_addresses "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_addressgroups "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_policies "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_scripts "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_backups "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py"
click node_dhcp "https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.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_client,node_user toneBlue
class node_adoms,node_packages toneAmber
class node_addresses,node_addressgroups toneMint
class node_policies toneRose
class node_scripts,node_backups,node_dhcp,node_fm toneIndigo
```

## Components

### API client

- [FortiManager client](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`

### Administration

- [ADOM operations](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`
- [Policy packages](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`

### Address configuration

- [Address objects](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`
- [Address groups](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`

### Policies

- [Firewall policies](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`

### Automation

- [Scripts](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`
- [Configuration backup](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`
- [DHCP operations](https://github.com/akshaymane920/pyfortimanagerapi/blob/master/src/pyFortiManagerAPI.py): `src/pyFortiManagerAPI.py`

### Other components

- **API user**
- **FortiManager**

## Connections

- API user → FortiManager client: configures (evidence: `README.md`)
- API user → ADOM operations: invokes (evidence: `README.md`)
- API user → Policy packages: invokes (evidence: `README.md`)
- API user → Address objects: invokes (evidence: `README.md`)
- API user → Address groups: invokes (evidence: `README.md`)
- ADOM operations → FortiManager: sends JSON-RPC
- Policy packages → FortiManager: sends JSON-RPC (evidence: `src/pyFortiManagerAPI.py`)
- Address objects → FortiManager: sends JSON-RPC (evidence: `src/pyFortiManagerAPI.py`)
- Address groups → FortiManager: sends JSON-RPC (evidence: `src/pyFortiManagerAPI.py`)
- Firewall policies → FortiManager: sends JSON-RPC (evidence: `src/pyFortiManagerAPI.py`)
- Scripts → FortiManager: sends JSON-RPC (evidence: `src/pyFortiManagerAPI.py`)
- Configuration backup → FortiManager: sends JSON-RPC
- DHCP operations → FortiManager: sends JSON-RPC (evidence: `src/pyFortiManagerAPI.py`)
