{ "info": { "author": "Cox Communications Inc.", "author_email": "jason.cole@cox.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.7", "Topic :: System :: Networking" ], "description": "\n\n# Network Automation Simplified - NAMS\nDemonstrations are available within the Docker Container using Jupyter notebooks.\n\n## Summary \n\n\n\nSuppose you must implement a network change. You probably have a standard sequence of steps you typically follow. You may be able to predict the steps you'll need to perform solely from experience. You may have a formalized document detailing the sequence of tasks consisting of 4, 6 or 10 steps, depending on what you're doing. For example, your typical steps are probably similar to the pseudocode written below:\n\n**Pre Change**\n> Collect and save 'show commands' \n\n> Validate the router's health \n\n**Apply the Configuration**\n> Paste in the configurations \n\n> Examine the 'diff'\n\n> 'Commit'\n\n**Post Change**\n\n> Allow convergence\n\n> Validate the router's health \n\n> Collect and save 'show commands' \n\n> (optional) 'confirm' or 'rollback' \n\n\nYou can probably come up with several other tasks for different use-cases, all of which would likely be a slight variation of this. For instance, rather than 'commiting' the configuration, you may only want to perform a 'diff' to see what the change *would* look like. You may only want to collect 'show commands' to verify a configuration exists or to collect IGP adjacency information, or you may want to only perform health checks, because you're validating the functionality of every configured protocol on the node as you're testing a new version of code. \n\nTasks like these, and the templatized sequence of these tasks, is provided by the NAMS library. The ncclient, Nornir and Jsnapy libraries are abstracted from the user to provide a simple interface for network automation. As an introduction, explore the demo below to see a typical use-case; but don't stop there, because there are a variety of other notebooks demonstrating simple *and* advanced capabilities of NAMS. You'll be surprised how much you can do with so few lines of code. \n\n## Installation\nDownload via **'pip'** or deploy as a **Docker Container**. The **Docker Container is recommended**. It allows 20+ pre-built Jupyter notebooks to be readily available via an interactive web-interface. Without the container, the notebook samples are viewable from within the Git repository, but they will be non-interactive and will not display results. The container will have NAMS, SSH, Jupyter and HTTP installed. It is also configured with lab and production router hostnames, as well as Linux aliases, to simplify administration. SSH allows direct container access over the network and HTTP allows easy log retrieval. Because containers are transferable between hosts, host X can be used for development and the container can be copied to host Y for production. Below is a summary of why the docker container is recommended:\n\n1. Simplifies installation \n2. Shortens development time\n3. Enables sharing\n4. Transferability \n5. Shell execution (see samples)\n\n### Python Package\nIf you prefer not to use the Docker Container, the Python package is available on PyPi.\n\n```\n# requires >= Python3.7\npip install network-automation-simplified\n```\n\nhttps://pypi.org/project/network-automation-simplified/\n\n### Docker\n\n*Important*: the docker container will only save host data stored in the \"/home\" and \"/svr/nams\" directories. All other data will be lost upon reboot/shutdown.\n\n##### Linux\n```\napt-get install docker\napt-get install docker-compose\ngit clone \ncd /docker\nsudo bash build.sh\n```\n\n##### Mac\n```\n# if 'brew' is installed\nbrew install docker \nbrew install docker-compose\nbrew install docker-machine\ngit clone \ncd /docker\nbash build.sh\n```\n\n##### Authentication\n\n| Defaults | Shell | SSH | Jupyter | HTTP |\n|:--------:|:-------:|:-------:|:-------:|:-----:|\n| username | root | admin | n/a | n/a |\n| password | install | install | n/a | n/a |\n| port | n/a | 10000 | 10001 | 10002 | \n\n##### Interfaces\n\n| Service | Client Interface | Example |\n|---------|------------------|-------------------------------|\n| Linux | host's shell | docker exec -it nams bash |\n| SSH | ssh client | ssh \\@\\ -p 10000 |\n| Jupyter | web browser | http://\\:10001 |\n| HTTP | web browser | http://\\:10002 |\n\n##### Problems\nIts possible that the host's docker network can assign a subnet that overlaps with devices you are attempting to connect to via nams. In this case, static routes are required on the host. e.g. create a static route to '172.17.248.0/24' if the Docker subnet is '172.17.0.0/16' and the router is '172.17.248.1/32'. \n\n## Why Another Library? \nThere are several existing tools written to perform network automation such as Ansible, NAPALM, Nornir, etc. Each tool has has strengths in different categories. This Python library leverages those strengths, for a more flexible and simpler solution with less development time required.\n\nThe following Python libraries are leveraged by NAMS:\n\n* ncclient\n* Nornir\n* Jsnapy \n\n#### ncclient\nncclient is Python library for interfacing with a NETCONF device. ncclient is leveraged by tools like Jsnapy and Ansible. It is vendor neutral and provides a 'raw', or unabstracted interface. The downside of working with ncclient is that it requires the user to perform inventory management, multiprocessing, error-handling, encoding conversions, file saving, etc. \n\nhttps://ncclient.readthedocs.io/en/latest/index.html\n\n#### Nornir\nNornir is a relatively new Python framework developed by the same creators of NAPALM and netmiko. It's primary role is to provide inventory management and multiprocessing for APIs like ncclient, NAPALM, netmiko, and others. One downfall of Nornir the ability to integrate Jsnapy. This is a critical component for health checks on Juniper devices. Because Nornir is an Open framework, a component of the framework, like inventory, can be re-used by others. Nornir's inventory is re-used by NAMS.\n\nhttps://nornir.readthedocs.io/en/stable/\n\n#### Jsnapy\nJsnapy is an excellent Python tool for executing health checks against JunOS platforms. It abstracts netconf requests and responses, by allowing test case definitions via a 'yaml' file. In the yaml file, various parameters state parameters of 'show' output can be validated. When a response is received and the test case passes, the node is considered health (vice versa for a failure). Jsnapy uses ncclient to interface with a device. \n\nhttps://github.com/Juniper/jsnapy\n\n#### NAPALM\nNAPALM is unified API for multi-vendor network environments. It translates high-level 'orders' into CLI commands. Additionally, it returns output as Python objects e.g. lists, dictionaries, etc. for easy parsing. This output is the same for all vendors. However, because there are so many results that would have to be translated into Python objects, not all commands are supported. Additionally, some vendors have support than others. The majority of support is in EOS systems which are uncommon to most network environments. To workaround this, the developers allow interfacing with devices through Netconf or netmiko without translating results but while performing with error handling. In a network domain of Juniper routers, it makes more sense to avoid the NAPALM API and leverage Juniper's Jsnapy interface with ncclient. This is because Jsnapy cannot easily be integrated into NAPALM without developer involvement.\n\nhttps://napalm.readthedocs.io/en/latest/\n\n#### Ansible\nAnsible is a YAML driven, network automation solution that supports native commands and Netconf for multiple vendors. It has an excellent inventory system for device management and generating configurations. YAML is a simple 'language' that users interface with; this hides the underlying Python code. Because of YAML abstraction, Ansible sacrifices flexibility. YAML is also not a 'programming language'. This can make seemingly simple tasks quite difficult to 'program' or even impossible. Another downside of Ansible is that an operation is executed on *all* routers before the next operation is performed. Examples below describe some scenarios that become quite challenging or impossible with Ansible:\n\n1. *Group Operations*: Executing multiple operations on a single router before moving to the next. Additionally, user prompting at each device.\n\n\n2. *Conditional Operations*: Suppose you want you want to get the configuration from all routers, find routers with 'X' configuration, and then make a change to only those select routers. \n\n\n3. *Speed*: Each operation requires a new SSH / NETCONF session. Suppose you have two tasks (1) get configuration (2) edit configuration. Each operation requires a new session. \n\nhttps://docs.ansible.com/\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pypa/sampleproject", "keywords": "ncclient,nornir,jsnapy", "license": "", "maintainer": "", "maintainer_email": "", "name": "network-automation-simplified", "package_url": "https://pypi.org/project/network-automation-simplified/", "platform": "", "project_url": "https://pypi.org/project/network-automation-simplified/", "project_urls": { "Homepage": "https://github.com/pypa/sampleproject" }, "release_url": "https://pypi.org/project/network-automation-simplified/0.0.1/", "requires_dist": [ "jsnapy", "xmltodict", "nornir", "recordclass" ], "requires_python": ">=3.7", "summary": "Network Automation Simplified", "version": "0.0.1" }, "last_serial": 5977755, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "399b217307b42b1930a22dfc202ad0e0", "sha256": "18dcdcf0c13f2513db2eb8204cca79f9cc62a41db637d354140f7acfc6614ef1" }, "downloads": -1, "filename": "network_automation_simplified-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "399b217307b42b1930a22dfc202ad0e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 19492, "upload_time": "2019-10-15T14:45:32", "url": "https://files.pythonhosted.org/packages/12/9b/e744aa94e728b7bfcd3532239456a5bc8fb76c741bcf2d1b78a6f679628a/network_automation_simplified-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87b53a517dceee144d21abdd33fa6ce7", "sha256": "02db3f830abd3f85b7cca55aa99d10fef425f2f6b24f81608a1c434ec0807f5e" }, "downloads": -1, "filename": "network-automation-simplified-0.0.1.tar.gz", "has_sig": false, "md5_digest": "87b53a517dceee144d21abdd33fa6ce7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 18596, "upload_time": "2019-10-15T14:45:35", "url": "https://files.pythonhosted.org/packages/b6/f4/bd121fff4d9cf55389ea2d3c1ce42c4ffe7ae617717743448bbb2e9b9a08/network-automation-simplified-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "399b217307b42b1930a22dfc202ad0e0", "sha256": "18dcdcf0c13f2513db2eb8204cca79f9cc62a41db637d354140f7acfc6614ef1" }, "downloads": -1, "filename": "network_automation_simplified-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "399b217307b42b1930a22dfc202ad0e0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 19492, "upload_time": "2019-10-15T14:45:32", "url": "https://files.pythonhosted.org/packages/12/9b/e744aa94e728b7bfcd3532239456a5bc8fb76c741bcf2d1b78a6f679628a/network_automation_simplified-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87b53a517dceee144d21abdd33fa6ce7", "sha256": "02db3f830abd3f85b7cca55aa99d10fef425f2f6b24f81608a1c434ec0807f5e" }, "downloads": -1, "filename": "network-automation-simplified-0.0.1.tar.gz", "has_sig": false, "md5_digest": "87b53a517dceee144d21abdd33fa6ce7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 18596, "upload_time": "2019-10-15T14:45:35", "url": "https://files.pythonhosted.org/packages/b6/f4/bd121fff4d9cf55389ea2d3c1ce42c4ffe7ae617717743448bbb2e9b9a08/network-automation-simplified-0.0.1.tar.gz" } ] }