Statistics
| Branch: | Tag: | Revision:

root / docs / source / intro.rst @ bbd4ce54

History | View | Annotate | Download (1.1 kB)

1 216bb34c Shikhar Bhushan
*************
2 216bb34c Shikhar Bhushan
Introduction
3 216bb34c Shikhar Bhushan
*************
4 216bb34c Shikhar Bhushan
5 0b7d3b31 Shikhar Bhushan
NCClient is a Python library for NETCONF clients. NETCONF is a network management protocol defined in :rfc:`4741`.
6 0b7d3b31 Shikhar Bhushan
7 0b7d3b31 Shikhar Bhushan
It is meant for Python 2.6+ (not Python 3 yet, though).
8 216bb34c Shikhar Bhushan
9 216bb34c Shikhar Bhushan
The features of NCClient include:
10 216bb34c Shikhar Bhushan
11 216bb34c Shikhar Bhushan
* Request pipelining.
12 216bb34c Shikhar Bhushan
* (A)synchronous RPC requests.
13 216bb34c Shikhar Bhushan
* Keeps XML out of the way unless really needed.
14 216bb34c Shikhar Bhushan
* Supports all operations and capabilities defined in :rfc:`4741`.
15 216bb34c Shikhar Bhushan
* Extensible. New transport mappings and capabilities/operations can be easily added.
16 216bb34c Shikhar Bhushan
17 216bb34c Shikhar Bhushan
The best way to introduce is of course, through a simple code example::
18 216bb34c Shikhar Bhushan
19 216bb34c Shikhar Bhushan
    from ncclient import manager
20 216bb34c Shikhar Bhushan
21 bbd4ce54 Shikhar Bhushan
    # use ssh-agent or ~/.ssh keys for auth, load known_hosts by default
22 bbd4ce54 Shikhar Bhushan
    with manager.connect_ssh('host', username='username') as m:
23 216bb34c Shikhar Bhushan
        assert(":url" in manager.server_capabilities)
24 216bb34c Shikhar Bhushan
        with m.locked('running'):
25 216bb34c Shikhar Bhushan
            m.copy_config(source="running", target="file://new_checkpoint.conf")
26 216bb34c Shikhar Bhushan
            m.copy_config(source="file://old_checkpoint.conf", target="running")
27 216bb34c Shikhar Bhushan
28 bbd4ce54 Shikhar Bhushan
It is recommended to use the high-level :class:`Manager` API where possible. It exposes all of the functionality except asynchronous RPC requests.