A collection of Python scripts and web applications for interacting with Ericsson NetCloud Manager APIs.
- Python 3.9 or higher — Windows users, see the Windows Python Setup Guide
- Git (optional, for cloning the repository)
git clone <repository-url>
cd api-samplesRun the setup script to create the virtual environment, install dependencies, and configure API credentials:
python3 setup_env.py # macOS/Linux
python setup_env.py # WindowsThis handles everything — venv creation, pip install, and credential configuration. After setup:
source .venv/bin/activateIf you prefer to set things up manually:
python3 -m venv .venv # macOS/Linux
# or: python -m venv .venv # Windows
source .venv/bin/activate # macOS/Linux
# or: .venv\Scripts\activate # Windows
pip install -r requirements.txtSet API keys:
export X_CP_API_ID="your_api_id"
export X_CP_API_KEY="your_api_key"
export X_ECM_API_ID="your_ecm_api_id"
export X_ECM_API_KEY="your_ecm_api_key"
export NCM_API_TOKEN="your_v3_bearer_token" # optional, for v3 APIDashboard apps also support configuring credentials via the Settings panel in the UI.
api-samples/
├── web_apps/ # Web applications and dashboards
├── scripts/ # Standalone Python scripts and utilities
├── ncm/ # NCM Python SDK source (also pip installable)
├── ncm2/ # NCM Python SDK v2+v3 variant
├── docs/ # API documentation and references
└── postman-collection/ # Postman API collection
All web applications live in web_apps/. See web_apps/README.md for full details.
| App | Port | Description |
|---|---|---|
| inventory_dashboard | 8060 | Device inventory with license status, subscriptions, modem info |
| cellular_health_dashboard | 8055 | Cellular health scores and signal metrics |
| script_manager | 8000 | CSV editor and NCM script runner with web UI |
| config_builder | 8100 | Build JSON configurations from templates |
| assign_sdk | 9000 | Assign SDK app versions to router groups |
| cisco_to_cradlepoint_zfw_converter | 5001 | Convert Cisco configs to Cradlepoint zone firewall |
| ncm_api_key_encryptor | 8000 | Encrypt API keys for SDK app configs |
| netcloud_router_lookup | 8000 | Look up router info by serial/MAC |
python3 web_apps/inventory_dashboard/serve.py # macOS/Linux
python web_apps/inventory_dashboard/serve.py # WindowsThe scripts/ folder contains standalone Python scripts demonstrating various API interactions:
- Router management and configuration
- User management (v3 API)
- Subscription management and regrades
- Device licensing and unlicensing
- Configuration backups
python3 scripts/<script_name>.py # macOS/Linux
python scripts/<script_name>.py # WindowsWeb-based interface for managing CSV files, API keys, and running scripts:
python3 web_apps/script_manager/script_manager.py # macOS/Linux
python web_apps/script_manager/script_manager.py # WindowsOpen http://localhost:8000 in your browser.
Pre-configured API requests for testing NCM endpoints in Postman. Import postman-collection/Ericsson NCM API Postman Collection.json into Postman.
The docs/ folder contains detailed API references:
- API Overview — auth, base URLs, pagination
- v2 Endpoints — routers, groups, net_devices, etc.
- v3 Endpoints — subscriptions, asset_endpoints, users
- SDK Reference — Python SDK methods
- Known Issues — API gotchas and workarounds
- Common Patterns — reusable code patterns
Missing API keys: Verify environment variables are set, or use the Settings panel in dashboard apps.
ModuleNotFoundError: Make sure your venv is activated and pip install -r requirements.txt was run.
Port already in use: Kill the existing process (lsof -ti:<port> | xargs kill) or use a different port.
See the LICENSE file for details.