{"id":24108,"library":"netapp-lib","title":"NetApp Library","description":"netapp-lib is a Python library required for Ansible deployments to interact with NetApp storage systems. It provides APIs for managing NetApp ONTAP and E-Series storage. Current version: 2021.6.25. Release cadence is sporadic.","status":"active","version":"2021.6.25","language":"python","source_language":"en","source_url":"https://github.com/NetApp/netapp-lib","tags":["netapp","storage","ontap","ansible","zapi"],"install":[{"cmd":"pip install netapp-lib","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Import from netapp_lib, not netapp or netapp-lib","symbol":"NaServer","correct":"from netapp_lib.api.zapi import NaServer"},{"note":"Import from netapp_lib, not netapp or netapp-lib","symbol":"NaElement","correct":"from netapp_lib.api.zapi import NaElement"}],"quickstart":{"code":"from netapp_lib.api.zapi import NaServer\n\n# Connect to a NetApp ONTAP system\nserver = NaServer('10.0.0.1', 443)\nserver.set_transport_type('HTTPS')\nserver.set_server_type('ONTAP')\n# Set admin credentials - in production use environment variables\nserver.set_admin_user('admin', 'password')  # nosec\n\n# Test connection\napi = NaElement('system-get-version')\nresult = server.invoke_element(api)\nprint(result.to_string())","lang":"python","description":"Connect to NetApp ONTAP and get system version"},"warnings":[{"fix":"If using Ansible, do not install netapp-lib separately; use the version that comes with the ansible package.","message":"netapp-lib is shipped with Ansible, but manually installed versions may conflict. Always use the version bundled with your Ansible installation to avoid incompatibility.","severity":"breaking","affected_versions":"all"},{"fix":"Consider using the NetApp ONTAP REST API directly or the na_ontap_* modules in Ansible.","message":"This library is in maintenance mode and receives only critical updates. It is replaced by the NetApp Ansible collection's own modules; direct use of netapp-lib is discouraged for new projects.","severity":"deprecated","affected_versions":"all"},{"fix":"Use 'import netapp_lib' or 'from netapp_lib.api.zapi import ...'","message":"The import path uses underscores (netapp_lib) not hyphens (netapp-lib). Many users mistakenly use the PyPI name directly.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'import netapp_lib' or 'from netapp_lib.api.zapi import NaServer'.","cause":"Trying to import 'netapp' instead of 'netapp_lib'.","error":"ModuleNotFoundError: No module named 'netapp'"},{"fix":"Install the package correctly: 'pip install netapp-lib' and import explicitly: 'from netapp_lib.api.zapi import NaServer'.","cause":"The netapp_lib package might be installed but incomplete, or the submodules are not imported automatically.","error":"AttributeError: module 'netapp_lib' has no attribute 'api'"},{"fix":"Verify connectivity, use correct hostname/IP and port. For testing, you can set server.set_transport_type('HTTP') and use port 80, but HTTP is insecure.","cause":"NetApp cluster or simulator not reachable or SSL certificate issues.","error":"requests.exceptions.ConnectionError: HTTPSConnectionPool(host='...', port=443): Max retries exceeded"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}