Package: ncclient
ncclient is a Python library that facilitates client-side scripting and
application development around the NETCONF protocol.ncclientwas
developed byShikar Bhushan <http://schmizz.net>. It is now
maintained byLeonidas Poulopoulos (@leopoul) <http://ncclient.org>andEinar Nilsen-Nygaard (@einarnn).Docs:http://ncclient.readthedocs.orgGithub:https://github.com/ncclient/ncclientRequirements:Python 2.7 or Python 3.4+setuptools 0.6+Paramiko 1.7+lxml 3.3.0+libxml2libxsltIf you are on Debian/Ubuntu install the following libs (via aptitude or
apt-get):libxml2-devlibxslt1-devInstallation:[ncclient] $ sudo python setup.py installor via pip:pip install ncclientExamples:[ncclient] $ python examples/juniper/*.pyUsageGet device running configUse either an interactive Python console (ipython) or integrate the
following in your code:from ncclient import manager

with manager.connect(host=host, port=830, username=user, hostkey_verify=False) as m:
    c = m.get_config(source='running').data_xml
    with open("%s.xml" % host, 'w') as f:
        f.write(c)As of 0.4.1 ncclient integrates Juniper’s and Cisco’s forks, lots of new concepts
have been introduced that ease management of Juniper and Cisco devices respectively.
The biggest change is the introduction of device handlers in connection paramms.
For example to invoke Juniper’s functions annd params one has to re-write the above withdevice_params={‘name’:’junos’}:from ncclient import manager

with manager.connect(host=host, port=830, username=user, hostkey_verify=False, device_params={'name':'junos'}) as m:
    c = m.get_config(source='running').data_xml
    with open("%s.xml" % host, 'w') as f:
        f.write(c)Device handlers are easy to implement and prove to be futureproof.Supported device handlersJuniper:device_params={‘name’:’junos’}Cisco:CSR:device_params={‘name’:’csr’}Nexus:device_params={‘name’:’nexus’}IOS XR:device_params={‘name’:’iosxr’}IOS XE:device_params={‘name’:’iosxe’}Huawei:device_params={‘name’:’huawei’}device_params={‘name’:’huaweiyang’}Nokia SR OS:device_params={‘name’:’sros’}H3C:device_params={‘name’:’h3c’}HP Comware:device_params={‘name’:’hpcomware’}Server or anything not in above:device_params={‘name’:’default’}Changes | briefv0.6.12Fix for accidental breakage of Juniper ExecuteRPC supportv0.6.11Support for custom client capabilitiesRestructuring/refactoring of example scriptsMinor bugfixesMinor unit test refactoringv0.6.10NETCONF call-home (RFC8071) supportYANG 1.1actionsupportNokia SR OS device handler supportRemoval of old ALU base-r13 API documentationIncreased test coverageVariety of bugfixes and minor enhancements from a variety of contributors since 0.6.9 (see commit history)Thanks to all contributors!v0.6.9Fix for breaking API changev0.6.8Pulled due to accidental breaking API changeVariety of small updates and bugfixes, but of note:Support for namespace prefixes for XPath queriesedit-configparameter validationSupport for multiple RPC errorsAPI to get supported device typesSupport for subtree filters with multiple top-level tagsThanks to all contributors!v0.6.7Variety of bugfixes from a variety of contributors since 0.6.6 (see commit history)v0.6.6Read ssh timeout from config file if not specified in method callTox supportHuge XML tree parser supportAdding optional bind address to connectv0.6.5Updated README for 0.6.5 releasev0.6.4Pin selectors2 to Python versions <= 3.4Fix config examples to actually use the nc namespaceFix: correctly set port for paramiko when using ssh_config fileTest: add test to check ProxyCommand uses correct portUpdate commits for py3Enhance Alcatel-Lucent-supportJuniper RPC: allow specifying format in CompareConfigurationParsing of NETCONF 1.1 frames no longer decodes each chunk of bytesFix filter in create_subscriptionValidate ‘with-defaults’ mode based on supported modes advertised in capability URIv0.6.3Fix homepage link registered with PyPiSSH Host Key checkingUpdated junos.py to resolve RestrictedUser errorClose the channel when closing SSH sessionInvoke self.parse() to ensure errors, if any, have been detected before check in ok()v0.6.2Migration to user selectors instead of select, allowing higher scale operationsImproved netconf:base:1.1 parsingGraceful exit on session closev0.6.0Fix use of new Python 3.7 keyword, asyncRe-enable Python 3.7v0.5.4Rollup of minor changes since 0.5.3Disablement of Python 3.7 due to async keyword issuev0.5.3Add notifications supportAdd support for ecdsa keysVarious bug fixesv0.5.2Add support for Python 3Improve Junos ioproc performancePerformance improvementsUpdated test casesMany bug and performance fixesv0.4.7Add support for netconf 1.1v0.4.6Fix multiple RPC error generationAdd support for cancel-commit and persist paramAdd more examplesv0.4.5Add Huawei device supportAdd cli command support for hpcomware v7 devicesAdd H3C support, Support H3C CLI,Action,Get_bulk,Save,Rollback,etc.Add alcatel lucent supportRewrite multiple error handlingAdd coveralls support, with shield in README.mdSet severity level to higher when multipleSimplify logging and multi-error reportingKeep stacktrace of errorsCheck for known hosts on hostkey_verify onlyAdd check for device sending back null error_textFix RPC.raise_modeSpecifying hostkey_verify=False should not load_known_hostsCheck the correct field on rpc-error elementv0.4.3Nexus exec_command operationAllow specifying multiple cmd elements in Cisco NexusUpdate rpc for nested rpc-errorsPrevent race condition in threadingPrevent hanging in session closev0.4.2Support for paramiko ProxyCommand via ~/.ssh/config parsingAdd Juniper-specific commit operationsAdd Huawei devices supportTests/Travis supportioproc transport support for Juniper devicesUpdate Cisco CSR device handlerMany minor and major fixesv0.4.1Switch between replies if custom handler is foundAdd Juniper, Cisco and default device handlersAllow preferred SSH subsystem name in device paramsAllow iteration over multiple SSH subsystem names.Acknowledgementsv0.6.11: @musicinmybrain, @sstancu, @eariesv0.6.10: @vnitinv, @omaxx, @einarnn, @musicinmybrain, @tonynii, @sstancu, Martin Volf, @fredgan, @avisom, Viktor Velichkin, @ogenstad, @eariesv0.6.9: [Fred Gan](https://github.com/fredgan)v0.6.8: [Fred Gan](https://github.com/fredgan), @vnitinv, @kbijakowski, @iwanb, @badguy99, @liuyong, Andrew Mallory, William Lvoryv0.6.7: @vnitinv, @chaitu-tk, @sidhujasminder, @crutcha, @markgoddard, @ganeshrn, @songxl, @doesitblend, @psikala, @xuxiaowei0512, @muffizonev0.6.6: @sstancu, @hemna, @ishayansheikhv0.6.4: @davidhankins, @mzagozen, @knobix, @markafarrell, @psikala, @moepman, @apt-itude, @yuekyangv0.6.3: @rdkls, @Anthony25, @rsmekala, @vnitinv, @siming85v0.6.2: @einarnn, @glennmatthews, @bryan-stripe, @nickylbav0.6.0:Einar Nilsen-Nygaardv0.5.4: Variousv0.5.3:Justin Wilcox,Stacy W. Smith,Mircea Ulinic,Ebben Aries,Einar Nilsen-Nygaard,QijunPanv0.5.2:Nitin Kumar,Kristian Larsson,palashgupta,Jonathan Provost,Jainpriyal,sharang,pseguel,nnakamot,Алексей Пастухов,Christian Giese,Peipei Guo,Time Warner Cable Openstack Teamv0.4.7:Einar Nilsen-Nygaard,Vaibhav Bajpai, Norio Nakamotov0.4.6:Nitin Kumar,Carl Moberg,Stavros Kroustourisv0.4.5:Sebastian Wiesinger,Vincent Bernat,Matthew Stone,Nitin Kumarv0.4.3:Jeremy Schulman,Ray Solomon,Rick Sherman,subhak186v0.4.2:katharh,Francis Luong (Franco),Vincent Bernat,Juergen Brendel,Quentin Loos,Ray Solomon,Sebastian
Wiesinger,Ebben Ariesv0.4.1:Jeremy Schulman,Ebben Aries, Juergen Brendel