Skip to content

zenovalabs/meraki-org-manager

Repository files navigation

Meraki Org Manager

Meraki Org Manager is a standalone Python project for:

  • creating or updating a Cisco Meraki organization,
  • creating or updating a network,
  • claiming and onboarding devices by serial number,
  • assigning device names by SKU,
  • storing deployment parameters in a single configuration file,
  • managing the workflow through both CLI and a simple web UI.

The repository is structured to be readable, extensible, and safe to publish on GitHub without secrets.

Features

  • Idempotent deployment flow that checks whether the organization, network, and devices already exist.
  • Safe update behavior using updateOrganization, updateNetwork, and updateDevice for existing resources.
  • Single local configuration file stored in config/organizations.yaml, with a tracked example in config/organizations.yaml.example.
  • Credentials isolated in .env.
  • Web form for creating a new configuration or loading and editing an existing one by organization name.
  • Deployment logging written locally to logs/deployments.log, with a tracked sample log in logs/deployments.log.example.
  • Simple architecture with clear separation between repository, gateway, service, and web.
  • The project is intentionally extensible and can evolve beyond camera onboarding into broader organization setup and other Meraki device types.

Architecture

config/organizations.yaml        # local deployment parameters, gitignored
config/organizations.yaml.example
.env                             # API key and local runtime settings
src/meraki_org_manager/
  cli.py                         # CLI entry point
  web.py                         # FastAPI application and form handling
  settings.py                    # .env loading and settings normalization
  repository.py                  # YAML config read/write
  gateway.py                     # thin wrapper over the official Meraki SDK
  services/deployment.py         # idempotent deployment workflow
  models.py                      # config validation and serialization
  logging_utils.py               # file logging
tests/                           # unit tests

Requirements

  • Python 3.11+
  • uv
  • Cisco Meraki Dashboard API key with permissions to manage organizations, networks, and devices

Quick Start

mkdir -p ~/Projects
cd ~/Projects
git clone <your-repository-url> MerakiNewOrgDev
cd MerakiNewOrgDev
uv venv .venv
source .venv/bin/activate
uv pip install -e .
cp .env.example .env
cp config/organizations.yaml.example config/organizations.yaml

Fill in .env before the first real deployment:

MERAKI_DASHBOARD_API_KEY=...
MERAKI_CALLER=MerakiOrgManager/0.1.0 MerakiNewOrgDev
MERAKI_API_BASE_URL=https://api.meraki.com/api/v1

MERAKI_CALLER must follow the Meraki format ApplicationName/Version VendorName, without spaces or special characters inside each token.

After that, update config/organizations.yaml with your target organization, network, and device data.

Configuration

All local deployment parameters are stored in config/organizations.yaml.

The repository only tracks the sample file config/organizations.yaml.example. Copy it before your first real use:

cp config/organizations.yaml.example config/organizations.yaml

Each deployment entry contains:

  • organization: name and optional persisted id
  • network: name, timezone, product types, tags, and notes
  • devices: list of devices with sku, serial, name, tags, and notes
  • options: deployment behavior such as whether reassignment from another network is allowed

After a successful deployment, the configuration is updated with organization.id, network.id, and last_deployed_at.

If config/organizations.yaml does not exist yet, the app can still read the tracked example file as a starting point.

Usage

Deploy one saved organization configuration from the CLI:

meraki-org-manager deploy --org-name "Example Meraki Organization"

Start the web UI:

meraki-org-manager serve

Then open:

http://127.0.0.1:8000

Web Workflow

The web form supports:

  • creating a new configuration,
  • loading an existing configuration by organization name,
  • editing network and device parameters,
  • saving updates back to the YAML file,
  • immediately triggering a deployment to Meraki.

Security and Publishing

  • .env is ignored by Git.
  • runtime logs are ignored by Git.
  • config/organizations.yaml is ignored by Git.
  • only .env.example is committed.
  • only sample configuration and sample log files are committed.
  • the sample configuration file contains placeholder data only.

Before pushing publicly, verify that you are not committing:

  • real API keys,
  • production serial numbers,
  • local configuration values from config/organizations.yaml,
  • local log files.

Tests

python -m unittest discover -s tests

Meraki API Notes

The project follows common Meraki API workflows:

  • createOrganization / updateOrganization
  • createOrganizationNetwork / updateNetwork
  • getOrganizationInventoryDevice
  • claimIntoOrganizationInventory
  • claimNetworkDevices
  • removeNetworkDevices
  • updateDevice

If a device already belongs to another network, deployment stops with a conflict unless allow_reassign_devices is explicitly enabled.

About

Instant creating and managing Cisco Meraki Org from local web app with API into Meraki Dashboard.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors