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