Revision d215b592
b/ncclient/operations/edit.py | ||
---|---|---|
64 | 64 |
def request(self, target): |
65 | 65 |
"""Delete a configuration datastore. |
66 | 66 |
|
67 |
:param target: name or URL of configuration datastore to delete |
|
68 |
:type: :ref:`srctarget_params`""" |
|
67 |
*target* specifies the name or URL of configuration datastore to delete |
|
68 |
|
|
69 |
:seealso: :ref:`srctarget_params`""" |
|
69 | 70 |
node = new_ele("delete-config") |
70 | 71 |
node.append(util.datastore_or_url("target", target, self._assert)) |
71 | 72 |
return self._request(node) |
... | ... | |
78 | 79 |
"""Create or replace an entire configuration datastore with the contents of another complete |
79 | 80 |
configuration datastore. |
80 | 81 |
|
81 |
:param source: configuration datastore to use as the source of the copy operation or `config` element containing the configuration subtree to copy |
|
82 |
:type source: :ref:`srctarget_params` |
|
82 |
*source* is the name of the configuration datastore to use as the source of the copy operation or `config` element containing the configuration subtree to copy |
|
83 |
|
|
84 |
*target* is the name of the configuration datastore to use as the destination of the copy operation |
|
83 | 85 |
|
84 |
:param target: configuration datastore to use as the destination of the copy operation |
|
85 |
:type target: :ref:`srctarget_params`""" |
|
86 |
:seealso: :ref:`srctarget_params`""" |
|
86 | 87 |
node = new_ele("copy-config") |
87 | 88 |
node.append(util.datastore_or_url("target", target, self._assert)) |
88 | 89 |
node.append(util.datastore_or_url("source", source, self._assert)) |
... | ... | |
97 | 98 |
def request(self, source): |
98 | 99 |
"""Validate the contents of the specified configuration. |
99 | 100 |
|
100 |
:param source: name of the configuration datastore being validated or `config` element containing the configuration subtree to be validated |
|
101 |
:type source: :ref:`srctarget_params`""" |
|
101 |
*source* is the name of the configuration datastore being validated or `config` element containing the configuration subtree to be validated |
|
102 |
|
|
103 |
:seealso: :ref:`srctarget_params`""" |
|
102 | 104 |
node = new_ele("validate") |
103 | 105 |
try: |
104 | 106 |
src = validated_element(source, ("config", qualify("config"))) |
... | ... | |
119 | 121 |
|
120 | 122 |
A confirmed commit (i.e. if *confirmed* is `True`) is reverted if there is no followup commit within the *timeout* interval. If no timeout is specified the confirm timeout defaults to 600 seconds (10 minutes). A confirming commit may have the *confirmed* parameter but this is not required. Depends on the `:confirmed-commit` capability. |
121 | 123 |
|
122 |
:param confirmed: whether this is a confirmed commit |
|
123 |
:type confirmed: bool |
|
124 |
*confirmed* whether this is a confirmed commit |
|
124 | 125 |
|
125 |
:param timeout: confirm timeout in seconds |
|
126 |
:type timeout: int""" |
|
126 |
*timeout* confirm timeout in seconds""" |
|
127 | 127 |
node = new_ele("commit") |
128 | 128 |
if confirmed: |
129 | 129 |
self._assert(":confirmed-commit") |
b/ncclient/operations/flowmon.py | ||
---|---|---|
24 | 24 |
|
25 | 25 |
"*poweroff-machine* RPC (flowmon)" |
26 | 26 |
|
27 |
DEPENDS = ["urn:liberouter:params:netconf:capability:power-control:1.0"]
|
|
27 |
DEPENDS = ["urn:liberouter:param:netconf:capability:power-control:1.0"] |
|
28 | 28 |
|
29 | 29 |
def request(self): |
30 | 30 |
return self._request(new_ele(qualify("poweroff-machine", PC_URN))) |
b/ncclient/operations/retrieve.py | ||
---|---|---|
55 | 55 |
def request(self, filter=None): |
56 | 56 |
"""Retrieve running configuration and device state information. |
57 | 57 |
|
58 |
:param filter: portions of the device configuration to retrieve (by default entire configuration is retrieved) |
|
59 |
:type filter: :ref:`filter_params` |
|
58 |
*filter* specifies the portion of the configuration to retrieve (by default entire configuration is retrieved) |
|
59 |
|
|
60 |
:seealso: :ref:`filter_params` |
|
60 | 61 |
""" |
61 | 62 |
node = new_ele("get") |
62 | 63 |
if filter is not None: |
... | ... | |
73 | 74 |
def request(self, source, filter=None): |
74 | 75 |
"""Retrieve all or part of a specified configuration. |
75 | 76 |
|
76 |
:param source: name of the configuration datastore being queried |
|
77 |
:type source: string |
|
77 |
*source* name of the configuration datastore being queried |
|
78 |
|
|
79 |
*filter* specifies the portion of the configuration to retrieve (by default entire configuration is retrieved) |
|
78 | 80 |
|
79 |
:param filter: portions of the device configuration to retrieve (by default entire configuration is retrieved) |
|
80 |
:type filter: :ref:`filter_params`""" |
|
81 |
:seealso: :ref:`filter_params`""" |
|
81 | 82 |
node = new_ele("get-config") |
82 | 83 |
node.append(util.datastore_or_url("source", source, self._assert)) |
83 | 84 |
if filter is not None: |
b/ncclient/operations/rpc.py | ||
---|---|---|
260 | 260 |
|
261 | 261 |
In asynchronous mode, returns immediately, returning *self*. The :attr:`event` attribute will be set when the reply has been received (see :attr:`reply`) or an error occured (see :attr:`error`). |
262 | 262 |
|
263 |
:param op: operation to b\e requested |
|
264 |
:type ops: `~xml.etree.ElementTree.Element` |
|
263 |
*op* operation to be requested as an `~xml.etree.ElementTree.Element` |
|
265 | 264 |
|
266 |
:rtype: `RPCReply` (sync) or `RPC` (async)
|
|
265 |
Returns :class:`RPCReply` (sync) or :class:`RPC` (async)
|
|
267 | 266 |
""" |
268 | 267 |
logger.info('Requesting %r' % self.__class__.__name__) |
269 | 268 |
req = self._wrap(op) |
b/ncclient/transport/ssh.py | ||
---|---|---|
137 | 137 |
|
138 | 138 |
To disable attempting publickey authentication altogether, call with *allow_agent* and *look_for_keys* as `False`. |
139 | 139 |
|
140 |
:arg host: the hostname or IP address to connect to |
|
141 |
:type host: string |
|
140 |
*host* is the hostname or IP address to connect to |
|
142 | 141 |
|
143 |
:arg port: by default 830, but some devices use the default SSH port of 22 so this may need to be specified |
|
144 |
:type port: int |
|
142 |
*port* is by default 830, but some devices use the default SSH port of 22 so this may need to be specified |
|
145 | 143 |
|
146 |
:arg timeout: an optional timeout for socket connect |
|
147 |
:type timeout: int |
|
144 |
*timeout* is an optional timeout for socket connect |
|
148 | 145 |
|
149 |
:arg unknown_host_cb: called when the server host key is not recognized |
|
150 |
:type unknown_host_cb: see the signature of :func:`default_unknown_host_cb` |
|
146 |
*unknown_host_cb* is called when the server host key is not recognized. It takes two arguments, the hostname and the fingerprint (see the signature of :func:`default_unknown_host_cb`) |
|
151 | 147 |
|
152 |
:arg username: the username to use for SSH authentication |
|
153 |
:type username: string |
|
148 |
*username* is the username to use for SSH authentication |
|
154 | 149 |
|
155 |
:arg password: the password used if using password authentication, or the passphrase to use for unlocking keys that require it |
|
156 |
:type password: string |
|
150 |
*password* is the password used if using password authentication, or the passphrase to use for unlocking keys that require it |
|
157 | 151 |
|
158 |
:arg key_filename: a filename where a the private key to be used can be found |
|
159 |
:type key_filename: string |
|
152 |
*key_filename* is a filename where a the private key to be used can be found |
|
160 | 153 |
|
161 |
:arg allow_agent: enables querying SSH agent (if found) for keys |
|
162 |
:type allow_agent: bool |
|
154 |
*allow_agent* enables querying SSH agent (if found) for keys |
|
163 | 155 |
|
164 |
:arg look_for_keys: enables looking in the usual locations for ssh keys (e.g. :file:`~/.ssh/id_*`) |
|
165 |
:type look_for_keys: bool |
|
156 |
*look_for_keys* enables looking in the usual locations for ssh keys (e.g. :file:`~/.ssh/id_*`) |
|
166 | 157 |
""" |
167 | 158 |
if username is None: |
168 | 159 |
username = getpass.getuser() |
Also available in: Unified diff