pynetappfoundry
ONTAP administration library and CLI tools.
Installation
pip install pynetappfoundry
For development:
pip install -e ".[dev]"
CLI Usage
pynetappfoundry provides a single CLI entry point nf with subcommand groups:
# License management
nf licenses check --filter '{"bu":"Business"}'
nf licenses get --config-dir /path/to/config
nf licenses savings --output-dir ./output
# Reports
nf reports space-usage --filter '{"env":"Prod"}'
nf reports locks
nf reports html
# Events
nf events get --filter '{"name":"cluster1"}'
nf events save-azure
# Metrics
nf metrics dump-dii
# Utilities
nf utils validate
nf utils run-cmd "vol show"
nf utils sqlite-to-excel metrics.db
Common Options
All commands support these global options:
--config-dir, -c: Configuration directory path (default:config)--output-dir, -o: Output directory path--debug/--no-debug: Enable debug logging--filter, -f: JSON filter for cluster selection
Filter Syntax
The filter option accepts JSON with AND/OR logic:
# Match all criteria
-f '{"bu":"Business", "env":"Prod", "tags":"active"}'
# AND operator for tags
-f '{"tags":"active && workload"}'
# OR operator
-f '{"app": "app1 || app2"}'
# Multiple clusters by name
-f '{"name":"cluster1 || cluster2"}'
Library Usage
pynetappfoundry can also be used as a library in your own scripts:
from pynetappfoundry import Config, ONTAPAPIClient, ONTAPCLI
from pynetappfoundry.db import MetricDB
from pynetappfoundry.utils import approximate_size
# Load configuration
config = Config("/path/to/config")
clusters = config.get_clusters({"env": "Prod", "bu": "Business"})
# Query clusters
for name, details in clusters.items():
# Using the ONTAP Python SDK (via HostConnection)
user, password = config.get_user("clusters", name)
# Or use the CLI wrapper for SSH commands
cli = ONTAPCLI(name, details["ip"], user, password)
output = cli.run_command("vol show")
cli.disconnect()
# Work with metrics database
db = MetricDB(config)
db.create_table("cluster_metrics")
db.upsert_data("cluster_metrics", {"timestamp": "2024-01-01", "read_ops": 100})
Configuration
Create a config directory with TOML files:
settings.toml
[settings]
[settings.clusters]
searchable_keys = ["name", "bu", "env", "app", "tags"]
[settings.SMTP]
server = "smtp.example.com"
port = 25
user = ""
password = ""
auth = "False"
[settings.licensing]
mailfrom = "netapp-alerts@example.com"
mailto = "admin@example.com"
users.toml
[users.clusters]
user = "admin"
enc = "password"
clusters.toml
[settings]
type = "data"
[clusters.cluster1]
name = "cluster1"
ip = "10.0.0.1"
bu = "Business"
env = "Prod"
tags = ["active", "production"]
[clusters.cluster2]
name = "cluster2"
ip = "10.0.0.2"
bu = "Business"
env = "Dev"
tags = ["active", "development"]
Development
# Clone the repository
git clone https://github.com/endavis/pynetappfoundry.git
cd pynetappfoundry
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check src/
# Run type checking
mypy src/
License
MIT License - see LICENSE file for details.
Metadata
Release files for pynetappfoundry 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pynetappfoundry-0.1.0.tar.gz | 4.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynetappfoundry-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 MB
Release files / pynetappfoundry-0.1.0.tar.gz
| Download URL | pynetappfoundry-0.1.0.tar.gz |
|---|---|
| Size | 4.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69a9e47b7ebd88c52e0dd6803652a9abf12ac25edd36c2c65f8971bdde227411
|
|
BLAKE2b-256 checksum How to use checksums |
b990a4d11643b1e0b75b54bebf3228f2a984324916f8a638ca1060695acb1a84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / pynetappfoundry-0.1.0-py3-none-any.whl
| Download URL | pynetappfoundry-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
989de53e60b599307dfeadf7fcf477b2dbc42d5f331ea595d473a5c4bd1dc71a
|
|
BLAKE2b-256 checksum How to use checksums |
316608da3da5ccf7bfeebab4766998858b6d18f78d1803f520df584681eca490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency log