/usr/share/doc/python-ncclient/html/index.html is in python-ncclient-doc 0.5.3-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome — ncclient 0.4.4 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.4.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="manager – High-level API" href="manager.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="manager.html" title="manager – High-level API"
accesskey="N">next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">ncclient 0.4.4 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="welcome">
<h1>Welcome<a class="headerlink" href="#welcome" title="Permalink to this headline">¶</a></h1>
<p><cite>ncclient</cite> is a Python library for NETCONF clients. It aims to offer an intuitive API that sensibly maps the XML-encoded nature of NETCONF to Python constructs and idioms, and make writing network-management scripts easier. Other key features are:</p>
<ul class="simple">
<li>Supports all operations and capabilities defined in <span class="target" id="index-0"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4741.html"><strong>RFC 4741</strong></a>.</li>
<li>Request pipelining.</li>
<li>Asynchronous RPC requests.</li>
<li>Keeping XML out of the way unless really needed.</li>
<li>Extensible. New transport mappings and capabilities/operations can be easily added.</li>
</ul>
<p>The best way to introduce is through a simple code example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ncclient</span> <span class="k">import</span> <span class="n">manager</span>
<span class="c1"># use unencrypted keys from ssh-agent or ~/.ssh keys, and rely on known_hosts</span>
<span class="k">with</span> <span class="n">manager</span><span class="o">.</span><span class="n">connect_ssh</span><span class="p">(</span><span class="s2">"host"</span><span class="p">,</span> <span class="n">username</span><span class="o">=</span><span class="s2">"user"</span><span class="p">)</span> <span class="k">as</span> <span class="n">m</span><span class="p">:</span>
<span class="k">assert</span><span class="p">(</span><span class="s2">":url"</span> <span class="ow">in</span> <span class="n">m</span><span class="o">.</span><span class="n">server_capabilities</span><span class="p">)</span>
<span class="k">with</span> <span class="n">m</span><span class="o">.</span><span class="n">locked</span><span class="p">(</span><span class="s2">"running"</span><span class="p">):</span>
<span class="n">m</span><span class="o">.</span><span class="n">copy_config</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="s2">"running"</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">"file:///new_checkpoint.conf"</span><span class="p">)</span>
<span class="n">m</span><span class="o">.</span><span class="n">copy_config</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="s2">"file:///old_checkpoint.conf"</span><span class="p">,</span> <span class="n">target</span><span class="o">=</span><span class="s2">"running"</span><span class="p">)</span>
</pre></div>
</div>
<p>As of version 0.4 there has been an integration of Juniper’s and Cisco’s forks. Thus, 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 params.
For example to invoke Juniper’s functions and params one has to re-write the above with <strong>device_params={‘name’:’junos’}</strong>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">ncclient</span> <span class="k">import</span> <span class="n">manager</span>
<span class="k">with</span> <span class="n">manager</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="n">host</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">830</span><span class="p">,</span> <span class="n">username</span><span class="o">=</span><span class="n">user</span><span class="p">,</span> <span class="n">hostkey_verify</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">device_params</span><span class="o">=</span><span class="p">{</span><span class="s1">'name'</span><span class="p">:</span><span class="s1">'junos'</span><span class="p">})</span> <span class="k">as</span> <span class="n">m</span><span class="p">:</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">m</span><span class="o">.</span><span class="n">get_config</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="s1">'running'</span><span class="p">)</span><span class="o">.</span><span class="n">data_xml</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"</span><span class="si">%s</span><span class="s2">.xml"</span> <span class="o">%</span> <span class="n">host</span><span class="p">,</span> <span class="s1">'w'</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
</pre></div>
</div>
<p>Respectively, for Cisco Nexus, the name is <strong>nexus</strong>.
Device handlers are easy to implement and prove to be futureproof.</p>
<p>The latest pull request merge includes support for Huawei devices with name <strong>huawei</strong> in device_params.</p>
<div class="section" id="supported-device-handlers">
<h2>Supported device handlers<a class="headerlink" href="#supported-device-handlers" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Juniper: device_params={‘name’:’junos’}</li>
<li>Cisco CSR: device_params={‘name’:’csr’}</li>
<li>Cisco Nexus: device_params={‘name’:’nexus’}</li>
<li>Huawei: device_params={‘name’:’huawei’}</li>
</ul>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="manager.html"><code class="docutils literal"><span class="pre">manager</span></code> – High-level API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="manager.html#customizing">Customizing</a></li>
<li class="toctree-l2"><a class="reference internal" href="manager.html#factory-functions">Factory functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="manager.html#manager">Manager</a></li>
<li class="toctree-l2"><a class="reference internal" href="manager.html#special-kinds-of-parameters">Special kinds of parameters</a><ul>
<li class="toctree-l3"><a class="reference internal" href="manager.html#source-and-target-parameters">Source and target parameters</a></li>
<li class="toctree-l3"><a class="reference internal" href="manager.html#filter-parameters">Filter parameters</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">Complete API documentation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="capabilities.html"><code class="docutils literal"><span class="pre">capabilities</span></code> – NETCONF Capabilities</a></li>
<li class="toctree-l2"><a class="reference internal" href="xml_.html"><code class="docutils literal"><span class="pre">xml_</span></code> – XML handling</a><ul>
<li class="toctree-l3"><a class="reference internal" href="xml_.html#namespaces">Namespaces</a></li>
<li class="toctree-l3"><a class="reference internal" href="xml_.html#conversion">Conversion</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="transport.html"><code class="docutils literal"><span class="pre">transport</span></code> – Transport / Session layer</a><ul>
<li class="toctree-l3"><a class="reference internal" href="transport.html#base-types">Base types</a></li>
<li class="toctree-l3"><a class="reference internal" href="transport.html#ssh-session-implementation">SSH session implementation</a></li>
<li class="toctree-l3"><a class="reference internal" href="transport.html#errors">Errors</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="operations.html"><code class="docutils literal"><span class="pre">operations</span></code> – Everything RPC</a><ul>
<li class="toctree-l3"><a class="reference internal" href="operations.html#base-classes">Base classes</a></li>
<li class="toctree-l3"><a class="reference internal" href="operations.html#operations">Operations</a><ul>
<li class="toctree-l4"><a class="reference internal" href="operations.html#retrieval">Retrieval</a></li>
<li class="toctree-l4"><a class="reference internal" href="operations.html#editing">Editing</a></li>
<li class="toctree-l4"><a class="reference internal" href="operations.html#locking">Locking</a></li>
<li class="toctree-l4"><a class="reference internal" href="operations.html#session">Session</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="operations.html#exceptions">Exceptions</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="indices-and-tables">
<h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p align="center">
<a href="http://oss.schmizz.net/ncclient">
<img src="_static/logo.png" width="125" height="125"/>
</a>
</p>
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome</a><ul>
<li><a class="reference internal" href="#supported-device-handlers">Supported device handlers</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
</li>
</ul>
<h4>Next topic</h4>
<p class="topless"><a href="manager.html"
title="next chapter"><code class="docutils literal"><span class="pre">manager</span></code> – High-level API</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="manager.html" title="manager – High-level API"
>next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">ncclient 0.4.4 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2017, Shikhar Bhushan; 2011-2014, Leonidas Poulopoulos.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.6.
</div>
</body>
</html>
|