You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 24, 2023. It is now read-only.
The operation classes are currently undocumented. See documentation of :class:`~ncclient.manager.Manager` for methods that utilize the operation classes. The parameters accepted by :meth:`~RPC.request` for these classes are the same.
Copy file name to clipboardexpand all lines: ncclient/operations/rpc.py
+19-14
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ class RPCReply:
95
95
96
96
.. note::
97
97
If the reply has not yet been parsed there is an implicit, one-time parsing overhead to
98
-
accessing the attributes defined by this class and any subclasses.
98
+
accessing some of the attributes defined by this class.
99
99
"""
100
100
101
101
ERROR_CLS=RPCError
@@ -127,7 +127,7 @@ def parse(self):
127
127
self._parsed=True
128
128
129
129
def_parsing_hook(self, root):
130
-
"No-op by default. Gets given the *root* element."
130
+
"No-op by default. Gets passed the *root* element for the reply."
131
131
pass
132
132
133
133
@property
@@ -220,17 +220,24 @@ class RaiseMode(object):
220
220
221
221
classRPC(object):
222
222
223
-
"""Base class for all operations, directly corresponding to *rpc* requests. Handles making the
224
-
request, and taking delivery of the reply."""
223
+
"""Base class for all operations, directly corresponding to *rpc* requests. Handles making the request, and taking delivery of the reply."""
225
224
226
225
DEPENDS= []
227
-
"""Subclasses can specify their dependencies on capabilities. List of URI's or abbreviated names, e.g. ':writable-running'. These are verified at the time of instantiation. If the capability is not available, a :exc:`MissingCapabilityError` is raised.
228
-
"""
226
+
"""Subclasses can specify their dependencies on capabilities as a list of URI's or abbreviated names, e.g. ':writable-running'. These are verified at the time of instantiation. If the capability is not available, :exc:`MissingCapabilityError` is raised."""
229
227
230
228
REPLY_CLS=RPCReply
231
-
"Subclasses can specify a different reply class, but it should be a subclass of `RPCReply`."
229
+
"By default :class:`RPCReply`. Subclasses can specify a :class:`RPCReply` subclass."
*session* is the :class:`~ncclient.transport.Session` instance
234
+
235
+
*async* specifies whether the request is to be made asynchronously, see :attr:`is_async`
236
+
237
+
*timeout* is the timeout for a synchronous request, see :attr:`timeout`
238
+
239
+
*raise_mode* specifies the exception raising mode, see :attr:`raise_mode`
240
+
"""
234
241
self._session=session
235
242
try:
236
243
forcapinself.DEPENDS:
@@ -258,11 +265,9 @@ def _request(self, op):
258
265
259
266
In synchronous mode, blocks until the reply is received and returns :class:`RPCReply`. Depending on the :attr:`raise_mode` a `rpc-error` element in the reply may lead to an :exc:`RPCError` exception.
260
267
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
-
263
-
*op* operation to be requested as an `~xml.etree.ElementTree.Element`
268
+
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`).
264
269
265
-
Returns :class:`RPCReply` (sync) or :class:`RPC` (async)
270
+
*op* is the operation to be requested as an :class:`~xml.etree.ElementTree.Element`
"""Depending on this exception raising mode, an `rpc-error` in the reply may be raised as an :exc:`RPCError` exception. Valid values are the constants defined in :class:`RaiseMode`. """
Copy file name to clipboardexpand all lines: ncclient/transport/ssh.py
+1-1
Original file line number
Diff line number
Diff line change
@@ -309,5 +309,5 @@ def run(self):
309
309
310
310
@property
311
311
deftransport(self):
312
-
"Underlying `paramiko.Transport <http://www.lag.net/paramiko/docs/paramiko.Transport-class.html>`_ object. This makes it possible to call methods like set_keepalive on it."
312
+
"Underlying `paramiko.Transport <http://www.lag.net/paramiko/docs/paramiko.Transport-class.html>`_ object. This makes it possible to call methods like :meth:`~paramiko.Transport.set_keepalive` on it."
0 commit comments