{"id":24812,"library":"virl2-client","title":"VIRL2 (CML) Client Library","description":"The official Cisco VIRL2 / Cisco Modeling Labs (CML) client library for Python. Provides programmatic access to CML 2.x instances, supporting lab lifecycle management, node configuration, and system administration. Current version 2.9.1 (released 2025-01-06). Release cadence follows CML versions approximately twice a year.","status":"active","version":"2.9.1","language":"python","source_language":"en","source_url":"https://github.com/ciscodevnet/virl2-client","tags":["cisco","cml","virl2","network-automation","devnet"],"install":[{"cmd":"pip install virl2-client","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"This is the main entry point for interacting with a CML controller.","symbol":"CMLClient","correct":"from virl2_client import CMLClient"},{"note":"ClientLibrary was an alias in older versions (pre-2.4). Use CMLClient instead.","wrong":"from virl2_client import ClientLibrary","symbol":"ClientLibrary"}],"quickstart":{"code":"from virl2_client import CMLClient\n\nurl = os.environ.get('CML_URL', 'https://cml-controller.example.com')\nusername = os.environ.get('CML_USER', 'admin')\npassword = os.environ.get('CML_PASS', '')\n\nclient = CMLClient(url, username, password, ssl_verify=False)\nprint(f\"Connected to CML version {client.info.version}\")\nprint(f\"Labs on server: {len(client.labs)}\")","lang":"python","description":"Connects to a CML controller and prints server version and number of labs."},"warnings":[{"fix":"Use only controller-managed labs. If you need offline functionality, consider exporting/importing lab files manually.","message":"From v2.7.0, the offline/local lab functionality is deprecated and will be removed in a future release. Do not rely on it for new projects.","severity":"breaking","affected_versions":">=2.7.0"},{"fix":"client = CMLClient(url, username, password, ssl_verify=False)","message":"SSL verification defaults to True. If your CML controller uses a self-signed certificate, you must pass ssl_verify=False or provide a CA bundle.","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":"pip install virl2-client\nThen import using: from virl2_client import ...","cause":"The package is installed under the name 'virl2-client' (with hyphen) and the import uses an underscore.","error":"ModuleNotFoundError: No module named 'virl2_client'"},{"fix":"Check your CML server version. Upgrade to CML 2.6.0 or later, or avoid WebSocket features.","cause":"WebSocket functionality was added in CML 2.6.0. Older CML versions do not support it.","error":"virl2_client.exceptions.CML2InternalError: This CML version does not support WebSocket connections."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}