Registry / http-networking / netapp-ontap

netapp-ontap

JSON →
library9.18.1.0pypypi✓ verified 85d ago

The netapp-ontap Python client library simplifies interaction with NetApp ONTAP's REST APIs. It provides services for connection management, asynchronous request processing, and exception handling, enabling Python developers to quickly automate ONTAP deployments. The library's version aligns with the ONTAP major and minor versions it's generated from, with feature releases typically twice a year (Q2 and Q4) and service updates every 4-12 weeks.

pip install netapp-ontap
INSTALL
IMPORT
SIG · NETAPP-ONTAP
N
netapp-ontap
http-networkingpythonv9.18.1.0
Install
4.6s avg
Import
644ms
Disk
111MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.18.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.692s · 114.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.6s · import 0.596s · 115MB
111MB installed
● package 111MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HostConnection
from netapp_ontap import HostConnection
Used to establish a connection to an ONTAP cluster.
Cluster
from netapp_ontap.resources import Cluster
from netapp_ontap import Cluster
Resource objects like 'Cluster' are typically found in the 'resources' submodule.
Volume
from netapp_ontap.resources import Volume
Resource objects like 'Volume' are typically found in the 'resources' submodule.

This quickstart demonstrates how to establish a connection to an ONTAP cluster using environment variables for credentials and retrieve basic cluster information (name and UUID). It sets `verify=False` for simplicity in the example, but `verify=True` and proper certificate handling are recommended for production environments.

import os from netapp_ontap import HostConnection from netapp_ontap.resources import Cluster # Set connection details via environment variables for security ONTAP_HOST = os.environ.get('ONTAP_HOST', 'your_ontap_cluster_ip_or_hostname') ONTAP_USER = os.environ.get('ONTAP_USER', 'admin') ONTAP_PASS = os.environ.get('ONTAP_PASS', 'password') if ONTAP_HOST == 'your_ontap_cluster_ip_or_hostname': print("Please set ONTAP_HOST, ONTAP_USER, and ONTAP_PASS environment variables.") exit(1) try: # Establish a connection HostConnection(ONTAP_HOST, username=ONTAP_USER, password=ONTAP_PASS, verify=False) # Get cluster details cluster = Cluster.get_collection(fields='uuid,name')[0] print(f"Successfully connected to ONTAP cluster: {cluster.name} (UUID: {cluster.uuid})") except Exception as e: print(f"Error connecting to ONTAP or retrieving cluster details: {e}")
Debug
Known issues
breakingProperty names in ONTAP REST API that conflict with Python reserved keywords (e.g., 'class') are transposed by the library (e.g., to 'class_'). Similarly, if an action method name conflicts with a resource field, the action method might be renamed (e.g., 'sign()' to 'sign_action()').
fix
Always refer to the official documentation or use introspection to discover the correct Python property/method name for conflicting ONTAP API fields.
affects: All versions where such conflicts exist.
gotchaClient library versions are designed for specific ONTAP releases. A client library with a major version less than the target ONTAP release might not be fully compatible and unable to access newer REST APIs or correctly interpret new fields. The library may ignore unknown fields, return errors, or raise runtime exceptions.
fix
Ensure your `netapp-ontap` library version's major and minor components (e.g., 9.X.Y) align with or are newer than the target ONTAP cluster's version (e.g., ONTAP 9.X). Always upgrade the library to match or exceed your ONTAP cluster's version for full compatibility.
affects: All versions. Particularly when using an older client library with a newer ONTAP version.
deprecatedThe `netapp-lib` library, which supported the legacy ONTAP API (ONTAPI/ZAPI), is no longer maintained. While this `netapp-ontap` library focuses on REST APIs, users transitioning from older automation might encounter references to `netapp-lib`.
fix
Migrate any automation using `netapp-lib` (ZAPI) to use the `netapp-ontap` client library with ONTAP REST APIs. Consult NetApp's End-of-Availability announcements for ONTAPI.
affects: N/A (refers to a different library, but relevant for migration).
gotchaNewer ONTAP versions (e.g., 9.8 and later for TLS 1.0, 9.12.0 and later for TLS 1.1) disable older TLS protocols by default for new installations. For upgraded systems, TLS 1.0/1.1 might be automatically disabled if FIPS is enabled. This can impact connections from older clients or scripts.
fix
Ensure your Python environment and client scripts support modern TLS versions (1.2 or 1.3). If necessary, configure ONTAP to re-enable older TLS protocols (with caution for security implications) or update client systems.
affects: ONTAP 9.8+, 9.11.1+, 9.12.0+
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'netapp-ontap'
The `netapp-ontap` Python library is not installed in the current Python environment.
fix
Install the library using pip: `pip install netapp-ontap`
netapp_ontap.error.NetAppRestError: Caused by HTTPError('401 Client Error: Unauthorized for url: ...')
The provided credentials (username, password, or certificate) for accessing the ONTAP REST API are invalid or lack the necessary permissions for the requested operation.
fix
Verify the username and password used in the client configuration, and ensure the associated ONTAP user has the correct roles and HTTP/ONTAPI application access enabled on the ONTAP cluster.
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(...))
The Python client was unable to establish a network connection to the ONTAP system. This can be due to an incorrect IP address or hostname, an incorrect port, network firewall rules blocking access, or the ONTAP web service not running or being unreachable.
fix
Check the ONTAP system's IP address/hostname and port, verify network connectivity from the client (e.g., using `ping` or `telnet`), and ensure the ONTAP REST API service is enabled and reachable on the specified port.
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate
The Python client failed to verify the SSL/TLS certificate presented by the ONTAP system. This typically occurs when the ONTAP system uses a self-signed certificate or a certificate issued by a Certificate Authority (CA) not trusted by the client's operating system or Python environment.
fix
To bypass certificate verification (use with caution in production), initialize the ONTAP client with `verify=False`. For a secure solution, provide the path to a trusted CA certificate bundle or install the ONTAP system's CA certificate into your client's trust store.
Upgrade
Version history
9.18.1.0latest on PyPI · released Feb 2, 2026
Audit
Dependencies
pythonrequiredRequired runtime environment.
requestsrequiredHTTP client for API communication.
requests-toolbeltrequiredUtilities for requests library.
marshmallowrequiredObject serialization/deserialization.
apipkgrequiredManages package imports.
urllib3optionalStrongly suggested for security fixes.
certifioptionalRecommended for updated root certificates.
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources
netapp-ontap — pip install netapp-ontap · libregistry