scrapli 2.0.0a2__py3-none-musllinux_1_1_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scrapli/__init__.py +30 -0
- scrapli/auth.py +216 -0
- scrapli/cli.py +1414 -0
- scrapli/cli_decorators.py +148 -0
- scrapli/cli_parse.py +161 -0
- scrapli/cli_result.py +197 -0
- scrapli/definitions/__init__.py +1 -0
- scrapli/definitions/arista_eos.yaml +64 -0
- scrapli/definitions/cisco_iosxe.yaml +63 -0
- scrapli/definitions/cisco_iosxr.yaml +47 -0
- scrapli/definitions/cisco_nxos.yaml +64 -0
- scrapli/definitions/juniper_junos.yaml +85 -0
- scrapli/definitions/nokia_srlinux.yaml +35 -0
- scrapli/exceptions.py +49 -0
- scrapli/ffi.py +76 -0
- scrapli/ffi_mapping.py +202 -0
- scrapli/ffi_mapping_cli.py +646 -0
- scrapli/ffi_mapping_netconf.py +1612 -0
- scrapli/ffi_mapping_options.py +1031 -0
- scrapli/ffi_types.py +154 -0
- scrapli/helper.py +95 -0
- scrapli/lib/__init__.py +1 -0
- scrapli/lib/libscrapli.0.0.1-alpha.10.dylib +0 -0
- scrapli/lib/libscrapli.so.0.0.1-alpha.10 +0 -0
- scrapli/netconf.py +2804 -0
- scrapli/netconf_decorators.py +148 -0
- scrapli/netconf_result.py +72 -0
- scrapli/py.typed +0 -0
- scrapli/session.py +122 -0
- scrapli/transport.py +401 -0
- scrapli-2.0.0a2.dist-info/METADATA +49 -0
- scrapli-2.0.0a2.dist-info/RECORD +35 -0
- scrapli-2.0.0a2.dist-info/WHEEL +5 -0
- scrapli-2.0.0a2.dist-info/licenses/LICENSE +21 -0
- scrapli-2.0.0a2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1612 @@
|
|
1
|
+
"""scrapli.ffi_mapping_cli"""
|
2
|
+
|
3
|
+
from collections.abc import Callable
|
4
|
+
from ctypes import (
|
5
|
+
CDLL,
|
6
|
+
c_bool,
|
7
|
+
c_char_p,
|
8
|
+
c_int,
|
9
|
+
c_uint8,
|
10
|
+
c_uint64,
|
11
|
+
)
|
12
|
+
|
13
|
+
from _ctypes import POINTER
|
14
|
+
|
15
|
+
from scrapli.ffi_types import (
|
16
|
+
CancelPointer,
|
17
|
+
DriverPointer,
|
18
|
+
IntPointer,
|
19
|
+
LogFuncCallback,
|
20
|
+
OperationId,
|
21
|
+
OperationIdPointer,
|
22
|
+
U64Pointer,
|
23
|
+
ZigSlice,
|
24
|
+
ZigSlicePointer,
|
25
|
+
)
|
26
|
+
|
27
|
+
|
28
|
+
class LibScrapliNetconfMapping:
|
29
|
+
"""
|
30
|
+
Mapping to libscrapli netconf object functions mapping.
|
31
|
+
|
32
|
+
Should not be used/called directly.
|
33
|
+
|
34
|
+
Args:
|
35
|
+
N/A
|
36
|
+
|
37
|
+
Returns:
|
38
|
+
None
|
39
|
+
|
40
|
+
Raises:
|
41
|
+
N/A
|
42
|
+
|
43
|
+
"""
|
44
|
+
|
45
|
+
def __init__(self, lib: CDLL) -> None: # noqa: PLR0915
|
46
|
+
self._alloc: Callable[
|
47
|
+
[
|
48
|
+
LogFuncCallback,
|
49
|
+
c_char_p,
|
50
|
+
c_int,
|
51
|
+
c_char_p,
|
52
|
+
],
|
53
|
+
DriverPointer,
|
54
|
+
] = lib.ls_netconf_alloc
|
55
|
+
lib.ls_netconf_alloc.argtypes = [
|
56
|
+
LogFuncCallback,
|
57
|
+
c_char_p,
|
58
|
+
c_int,
|
59
|
+
c_char_p,
|
60
|
+
]
|
61
|
+
lib.ls_netconf_alloc.restype = DriverPointer
|
62
|
+
|
63
|
+
self._open: Callable[
|
64
|
+
[
|
65
|
+
DriverPointer,
|
66
|
+
OperationIdPointer,
|
67
|
+
CancelPointer,
|
68
|
+
],
|
69
|
+
int,
|
70
|
+
] = lib.ls_netconf_open
|
71
|
+
lib.ls_netconf_open.argtypes = [
|
72
|
+
DriverPointer,
|
73
|
+
OperationIdPointer,
|
74
|
+
CancelPointer,
|
75
|
+
]
|
76
|
+
lib.ls_netconf_open.restype = c_uint8
|
77
|
+
|
78
|
+
self._close: Callable[
|
79
|
+
[
|
80
|
+
DriverPointer,
|
81
|
+
OperationIdPointer,
|
82
|
+
CancelPointer,
|
83
|
+
c_bool,
|
84
|
+
],
|
85
|
+
int,
|
86
|
+
] = lib.ls_netconf_close
|
87
|
+
lib.ls_netconf_close.argtypes = [
|
88
|
+
DriverPointer,
|
89
|
+
OperationIdPointer,
|
90
|
+
CancelPointer,
|
91
|
+
c_bool,
|
92
|
+
]
|
93
|
+
lib.ls_netconf_close.restype = c_uint8
|
94
|
+
|
95
|
+
self._fetch_sizes: Callable[
|
96
|
+
[
|
97
|
+
DriverPointer,
|
98
|
+
OperationId,
|
99
|
+
IntPointer,
|
100
|
+
IntPointer,
|
101
|
+
IntPointer,
|
102
|
+
IntPointer,
|
103
|
+
IntPointer,
|
104
|
+
IntPointer,
|
105
|
+
],
|
106
|
+
int,
|
107
|
+
] = lib.ls_netconf_fetch_operation_sizes
|
108
|
+
lib.ls_netconf_fetch_operation_sizes.argtypes = [
|
109
|
+
DriverPointer,
|
110
|
+
OperationId,
|
111
|
+
IntPointer,
|
112
|
+
IntPointer,
|
113
|
+
IntPointer,
|
114
|
+
IntPointer,
|
115
|
+
IntPointer,
|
116
|
+
IntPointer,
|
117
|
+
]
|
118
|
+
lib.ls_netconf_fetch_operation_sizes.restype = c_uint8
|
119
|
+
|
120
|
+
self._fetch: Callable[
|
121
|
+
[
|
122
|
+
DriverPointer,
|
123
|
+
OperationId,
|
124
|
+
U64Pointer,
|
125
|
+
U64Pointer,
|
126
|
+
ZigSlicePointer,
|
127
|
+
ZigSlicePointer,
|
128
|
+
ZigSlicePointer,
|
129
|
+
ZigSlicePointer,
|
130
|
+
ZigSlicePointer,
|
131
|
+
ZigSlicePointer,
|
132
|
+
],
|
133
|
+
int,
|
134
|
+
] = lib.ls_netconf_fetch_operation
|
135
|
+
lib.ls_netconf_fetch_operation.argtypes = [
|
136
|
+
DriverPointer,
|
137
|
+
OperationId,
|
138
|
+
POINTER(c_uint64),
|
139
|
+
POINTER(c_uint64),
|
140
|
+
POINTER(ZigSlice),
|
141
|
+
POINTER(ZigSlice),
|
142
|
+
POINTER(ZigSlice),
|
143
|
+
POINTER(ZigSlice),
|
144
|
+
POINTER(ZigSlice),
|
145
|
+
POINTER(ZigSlice),
|
146
|
+
]
|
147
|
+
lib.ls_netconf_fetch_operation.restype = c_uint8
|
148
|
+
|
149
|
+
self._get_session_id: Callable[
|
150
|
+
[
|
151
|
+
DriverPointer,
|
152
|
+
IntPointer,
|
153
|
+
],
|
154
|
+
int,
|
155
|
+
] = lib.ls_netconf_get_session_id
|
156
|
+
lib.ls_netconf_get_session_id.argtypes = [
|
157
|
+
DriverPointer,
|
158
|
+
IntPointer,
|
159
|
+
]
|
160
|
+
lib.ls_netconf_get_session_id.restype = c_uint8
|
161
|
+
|
162
|
+
self._get_subscription_id: Callable[
|
163
|
+
[
|
164
|
+
c_char_p,
|
165
|
+
U64Pointer,
|
166
|
+
],
|
167
|
+
int,
|
168
|
+
] = lib.ls_netconf_get_subscription_id
|
169
|
+
lib.ls_netconf_get_subscription_id.argtypes = [
|
170
|
+
c_char_p,
|
171
|
+
POINTER(c_uint64),
|
172
|
+
]
|
173
|
+
lib.ls_netconf_get_subscription_id.restype = c_uint8
|
174
|
+
|
175
|
+
self._get_next_notification_size: Callable[
|
176
|
+
[
|
177
|
+
DriverPointer,
|
178
|
+
U64Pointer,
|
179
|
+
],
|
180
|
+
int,
|
181
|
+
] = lib.ls_netconf_next_notification_message_size
|
182
|
+
lib.ls_netconf_next_notification_message_size.argtypes = [
|
183
|
+
DriverPointer,
|
184
|
+
POINTER(c_uint64),
|
185
|
+
]
|
186
|
+
lib.ls_netconf_next_notification_message_size.restype = c_uint8
|
187
|
+
|
188
|
+
self._get_next_notification: Callable[
|
189
|
+
[
|
190
|
+
DriverPointer,
|
191
|
+
ZigSlicePointer,
|
192
|
+
],
|
193
|
+
int,
|
194
|
+
] = lib.ls_netconf_next_notification_message
|
195
|
+
lib.ls_netconf_next_notification_message.argtypes = [
|
196
|
+
DriverPointer,
|
197
|
+
POINTER(ZigSlice),
|
198
|
+
]
|
199
|
+
lib.ls_netconf_next_notification_message.restype = c_uint8
|
200
|
+
|
201
|
+
self._get_next_subscription_size: Callable[
|
202
|
+
[
|
203
|
+
DriverPointer,
|
204
|
+
c_uint64,
|
205
|
+
U64Pointer,
|
206
|
+
],
|
207
|
+
int,
|
208
|
+
] = lib.ls_netconf_next_subscription_message_size
|
209
|
+
lib.ls_netconf_next_subscription_message_size.argtypes = [
|
210
|
+
DriverPointer,
|
211
|
+
c_uint64,
|
212
|
+
POINTER(c_uint64),
|
213
|
+
]
|
214
|
+
lib.ls_netconf_next_subscription_message_size.restype = c_uint8
|
215
|
+
|
216
|
+
self._get_next_subscription: Callable[
|
217
|
+
[
|
218
|
+
DriverPointer,
|
219
|
+
c_uint64,
|
220
|
+
ZigSlicePointer,
|
221
|
+
],
|
222
|
+
int,
|
223
|
+
] = lib.ls_netconf_next_subscription_message
|
224
|
+
lib.ls_netconf_next_subscription_message.argtypes = [
|
225
|
+
DriverPointer,
|
226
|
+
c_uint64,
|
227
|
+
POINTER(ZigSlice),
|
228
|
+
]
|
229
|
+
lib.ls_netconf_next_subscription_message.restype = c_uint8
|
230
|
+
|
231
|
+
self._raw_rpc: Callable[
|
232
|
+
[
|
233
|
+
DriverPointer,
|
234
|
+
OperationIdPointer,
|
235
|
+
CancelPointer,
|
236
|
+
c_char_p,
|
237
|
+
c_char_p,
|
238
|
+
c_char_p,
|
239
|
+
],
|
240
|
+
int,
|
241
|
+
] = lib.ls_netconf_raw_rpc
|
242
|
+
lib.ls_netconf_raw_rpc.argtypes = [
|
243
|
+
DriverPointer,
|
244
|
+
OperationIdPointer,
|
245
|
+
CancelPointer,
|
246
|
+
c_char_p,
|
247
|
+
c_char_p,
|
248
|
+
c_char_p,
|
249
|
+
]
|
250
|
+
lib.ls_netconf_raw_rpc.restype = c_uint8
|
251
|
+
|
252
|
+
self._get_config: Callable[
|
253
|
+
[
|
254
|
+
DriverPointer,
|
255
|
+
OperationIdPointer,
|
256
|
+
CancelPointer,
|
257
|
+
c_char_p,
|
258
|
+
c_char_p,
|
259
|
+
c_char_p,
|
260
|
+
c_char_p,
|
261
|
+
c_char_p,
|
262
|
+
c_char_p,
|
263
|
+
],
|
264
|
+
int,
|
265
|
+
] = lib.ls_netconf_get_config
|
266
|
+
lib.ls_netconf_get_config.argtypes = [
|
267
|
+
DriverPointer,
|
268
|
+
OperationIdPointer,
|
269
|
+
CancelPointer,
|
270
|
+
c_char_p,
|
271
|
+
c_char_p,
|
272
|
+
c_char_p,
|
273
|
+
c_char_p,
|
274
|
+
c_char_p,
|
275
|
+
c_char_p,
|
276
|
+
]
|
277
|
+
lib.ls_netconf_get_config.restype = c_uint8
|
278
|
+
|
279
|
+
self._edit_config: Callable[
|
280
|
+
[
|
281
|
+
DriverPointer,
|
282
|
+
OperationIdPointer,
|
283
|
+
CancelPointer,
|
284
|
+
c_char_p,
|
285
|
+
c_char_p,
|
286
|
+
],
|
287
|
+
int,
|
288
|
+
] = lib.ls_netconf_edit_config
|
289
|
+
lib.ls_netconf_edit_config.argtypes = [
|
290
|
+
DriverPointer,
|
291
|
+
OperationIdPointer,
|
292
|
+
CancelPointer,
|
293
|
+
c_char_p,
|
294
|
+
c_char_p,
|
295
|
+
]
|
296
|
+
lib.ls_netconf_edit_config.restype = c_uint8
|
297
|
+
|
298
|
+
self._copy_config: Callable[
|
299
|
+
[
|
300
|
+
DriverPointer,
|
301
|
+
OperationIdPointer,
|
302
|
+
CancelPointer,
|
303
|
+
c_char_p,
|
304
|
+
c_char_p,
|
305
|
+
],
|
306
|
+
int,
|
307
|
+
] = lib.ls_netconf_copy_config
|
308
|
+
lib.ls_netconf_copy_config.argtypes = [
|
309
|
+
DriverPointer,
|
310
|
+
OperationIdPointer,
|
311
|
+
CancelPointer,
|
312
|
+
c_char_p,
|
313
|
+
c_char_p,
|
314
|
+
]
|
315
|
+
lib.ls_netconf_copy_config.restype = c_uint8
|
316
|
+
|
317
|
+
self._delete_config: Callable[
|
318
|
+
[
|
319
|
+
DriverPointer,
|
320
|
+
OperationIdPointer,
|
321
|
+
CancelPointer,
|
322
|
+
c_char_p,
|
323
|
+
],
|
324
|
+
int,
|
325
|
+
] = lib.ls_netconf_delete_config
|
326
|
+
lib.ls_netconf_delete_config.argtypes = [
|
327
|
+
DriverPointer,
|
328
|
+
OperationIdPointer,
|
329
|
+
CancelPointer,
|
330
|
+
c_char_p,
|
331
|
+
]
|
332
|
+
lib.ls_netconf_delete_config.restype = c_uint8
|
333
|
+
|
334
|
+
self._lock: Callable[
|
335
|
+
[
|
336
|
+
DriverPointer,
|
337
|
+
OperationIdPointer,
|
338
|
+
CancelPointer,
|
339
|
+
c_char_p,
|
340
|
+
],
|
341
|
+
int,
|
342
|
+
] = lib.ls_netconf_lock
|
343
|
+
lib.ls_netconf_lock.argtypes = [
|
344
|
+
DriverPointer,
|
345
|
+
OperationIdPointer,
|
346
|
+
CancelPointer,
|
347
|
+
c_char_p,
|
348
|
+
]
|
349
|
+
lib.ls_netconf_lock.restype = c_uint8
|
350
|
+
|
351
|
+
self._unlock: Callable[
|
352
|
+
[
|
353
|
+
DriverPointer,
|
354
|
+
OperationIdPointer,
|
355
|
+
CancelPointer,
|
356
|
+
c_char_p,
|
357
|
+
],
|
358
|
+
int,
|
359
|
+
] = lib.ls_netconf_unlock
|
360
|
+
lib.ls_netconf_unlock.argtypes = [
|
361
|
+
DriverPointer,
|
362
|
+
OperationIdPointer,
|
363
|
+
CancelPointer,
|
364
|
+
c_char_p,
|
365
|
+
]
|
366
|
+
lib.ls_netconf_unlock.restype = c_uint8
|
367
|
+
|
368
|
+
self._get: Callable[
|
369
|
+
[
|
370
|
+
DriverPointer,
|
371
|
+
OperationIdPointer,
|
372
|
+
CancelPointer,
|
373
|
+
c_char_p,
|
374
|
+
c_char_p,
|
375
|
+
c_char_p,
|
376
|
+
c_char_p,
|
377
|
+
c_char_p,
|
378
|
+
],
|
379
|
+
int,
|
380
|
+
] = lib.ls_netconf_get
|
381
|
+
lib.ls_netconf_get.argtypes = [
|
382
|
+
DriverPointer,
|
383
|
+
OperationIdPointer,
|
384
|
+
CancelPointer,
|
385
|
+
c_char_p,
|
386
|
+
c_char_p,
|
387
|
+
c_char_p,
|
388
|
+
c_char_p,
|
389
|
+
c_char_p,
|
390
|
+
]
|
391
|
+
lib.ls_netconf_get.restype = c_uint8
|
392
|
+
|
393
|
+
self._close_session: Callable[
|
394
|
+
[
|
395
|
+
DriverPointer,
|
396
|
+
OperationIdPointer,
|
397
|
+
CancelPointer,
|
398
|
+
],
|
399
|
+
int,
|
400
|
+
] = lib.ls_netconf_close_session
|
401
|
+
lib.ls_netconf_close_session.argtypes = [
|
402
|
+
DriverPointer,
|
403
|
+
OperationIdPointer,
|
404
|
+
CancelPointer,
|
405
|
+
]
|
406
|
+
lib.ls_netconf_close_session.restype = c_uint8
|
407
|
+
|
408
|
+
self._kill_session: Callable[
|
409
|
+
[
|
410
|
+
DriverPointer,
|
411
|
+
OperationIdPointer,
|
412
|
+
CancelPointer,
|
413
|
+
c_int,
|
414
|
+
],
|
415
|
+
int,
|
416
|
+
] = lib.ls_netconf_kill_session
|
417
|
+
lib.ls_netconf_kill_session.argtypes = [
|
418
|
+
DriverPointer,
|
419
|
+
OperationIdPointer,
|
420
|
+
CancelPointer,
|
421
|
+
c_int,
|
422
|
+
]
|
423
|
+
lib.ls_netconf_kill_session.restype = c_uint8
|
424
|
+
|
425
|
+
self._commit: Callable[
|
426
|
+
[
|
427
|
+
DriverPointer,
|
428
|
+
OperationIdPointer,
|
429
|
+
CancelPointer,
|
430
|
+
],
|
431
|
+
int,
|
432
|
+
] = lib.ls_netconf_commit
|
433
|
+
lib.ls_netconf_commit.argtypes = [
|
434
|
+
DriverPointer,
|
435
|
+
OperationIdPointer,
|
436
|
+
CancelPointer,
|
437
|
+
]
|
438
|
+
lib.ls_netconf_commit.restype = c_uint8
|
439
|
+
|
440
|
+
self._discard: Callable[
|
441
|
+
[
|
442
|
+
DriverPointer,
|
443
|
+
OperationIdPointer,
|
444
|
+
CancelPointer,
|
445
|
+
],
|
446
|
+
int,
|
447
|
+
] = lib.ls_netconf_discard
|
448
|
+
lib.ls_netconf_discard.argtypes = [
|
449
|
+
DriverPointer,
|
450
|
+
OperationIdPointer,
|
451
|
+
CancelPointer,
|
452
|
+
]
|
453
|
+
lib.ls_netconf_discard.restype = c_uint8
|
454
|
+
|
455
|
+
self._cancel_commit: Callable[
|
456
|
+
[
|
457
|
+
DriverPointer,
|
458
|
+
OperationIdPointer,
|
459
|
+
CancelPointer,
|
460
|
+
],
|
461
|
+
int,
|
462
|
+
] = lib.ls_netconf_cancel_commit
|
463
|
+
lib.ls_netconf_cancel_commit.argtypes = [
|
464
|
+
DriverPointer,
|
465
|
+
OperationIdPointer,
|
466
|
+
CancelPointer,
|
467
|
+
]
|
468
|
+
lib.ls_netconf_cancel_commit.restype = c_uint8
|
469
|
+
|
470
|
+
self._validate: Callable[
|
471
|
+
[
|
472
|
+
DriverPointer,
|
473
|
+
OperationIdPointer,
|
474
|
+
CancelPointer,
|
475
|
+
c_char_p,
|
476
|
+
],
|
477
|
+
int,
|
478
|
+
] = lib.ls_netconf_validate
|
479
|
+
lib.ls_netconf_validate.argtypes = [
|
480
|
+
DriverPointer,
|
481
|
+
OperationIdPointer,
|
482
|
+
CancelPointer,
|
483
|
+
c_char_p,
|
484
|
+
]
|
485
|
+
lib.ls_netconf_validate.restype = c_uint8
|
486
|
+
|
487
|
+
self._get_schema: Callable[
|
488
|
+
[
|
489
|
+
DriverPointer,
|
490
|
+
OperationIdPointer,
|
491
|
+
CancelPointer,
|
492
|
+
c_char_p,
|
493
|
+
c_char_p,
|
494
|
+
c_char_p,
|
495
|
+
],
|
496
|
+
int,
|
497
|
+
] = lib.ls_netconf_get_schema
|
498
|
+
lib.ls_netconf_get_schema.argtypes = [
|
499
|
+
DriverPointer,
|
500
|
+
OperationIdPointer,
|
501
|
+
CancelPointer,
|
502
|
+
c_char_p,
|
503
|
+
c_char_p,
|
504
|
+
c_char_p,
|
505
|
+
]
|
506
|
+
lib.ls_netconf_get_schema.restype = c_uint8
|
507
|
+
|
508
|
+
self._get_data: Callable[
|
509
|
+
[
|
510
|
+
DriverPointer,
|
511
|
+
OperationIdPointer,
|
512
|
+
CancelPointer,
|
513
|
+
c_char_p,
|
514
|
+
c_char_p,
|
515
|
+
c_char_p,
|
516
|
+
c_char_p,
|
517
|
+
c_char_p,
|
518
|
+
c_char_p,
|
519
|
+
c_char_p,
|
520
|
+
c_int,
|
521
|
+
c_bool,
|
522
|
+
c_char_p,
|
523
|
+
],
|
524
|
+
int,
|
525
|
+
] = lib.ls_netconf_get_data
|
526
|
+
lib.ls_netconf_get_data.argtypes = [
|
527
|
+
DriverPointer,
|
528
|
+
OperationIdPointer,
|
529
|
+
CancelPointer,
|
530
|
+
c_char_p,
|
531
|
+
c_char_p,
|
532
|
+
c_char_p,
|
533
|
+
c_char_p,
|
534
|
+
c_char_p,
|
535
|
+
c_char_p,
|
536
|
+
c_char_p,
|
537
|
+
c_int,
|
538
|
+
c_bool,
|
539
|
+
c_char_p,
|
540
|
+
]
|
541
|
+
lib.ls_netconf_get_data.restype = c_uint8
|
542
|
+
|
543
|
+
self._edit_data: Callable[
|
544
|
+
[
|
545
|
+
DriverPointer,
|
546
|
+
OperationIdPointer,
|
547
|
+
CancelPointer,
|
548
|
+
c_char_p,
|
549
|
+
c_char_p,
|
550
|
+
],
|
551
|
+
int,
|
552
|
+
] = lib.ls_netconf_edit_data
|
553
|
+
lib.ls_netconf_edit_data.argtypes = [
|
554
|
+
DriverPointer,
|
555
|
+
OperationIdPointer,
|
556
|
+
CancelPointer,
|
557
|
+
c_char_p,
|
558
|
+
c_char_p,
|
559
|
+
]
|
560
|
+
lib.ls_netconf_edit_data.restype = c_uint8
|
561
|
+
|
562
|
+
self._action: Callable[
|
563
|
+
[
|
564
|
+
DriverPointer,
|
565
|
+
OperationIdPointer,
|
566
|
+
CancelPointer,
|
567
|
+
c_char_p,
|
568
|
+
],
|
569
|
+
int,
|
570
|
+
] = lib.ls_netconf_action
|
571
|
+
lib.ls_netconf_action.argtypes = [
|
572
|
+
DriverPointer,
|
573
|
+
OperationIdPointer,
|
574
|
+
CancelPointer,
|
575
|
+
c_char_p,
|
576
|
+
]
|
577
|
+
lib.ls_netconf_action.restype = c_uint8
|
578
|
+
|
579
|
+
def alloc(
|
580
|
+
self,
|
581
|
+
*,
|
582
|
+
logger_callback: LogFuncCallback,
|
583
|
+
host: c_char_p,
|
584
|
+
port: c_int,
|
585
|
+
transport_kind: c_char_p,
|
586
|
+
) -> DriverPointer:
|
587
|
+
"""
|
588
|
+
Allocate a Netconf object.
|
589
|
+
|
590
|
+
Should (generally) not be called directly/by users.
|
591
|
+
|
592
|
+
Args:
|
593
|
+
logger_callback: pointer to logger callback function
|
594
|
+
host: host to connect to
|
595
|
+
port: port at which to connect
|
596
|
+
transport_kind: transport kind to use
|
597
|
+
|
598
|
+
Returns:
|
599
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
600
|
+
ctypes.
|
601
|
+
|
602
|
+
Raises:
|
603
|
+
N/A
|
604
|
+
|
605
|
+
"""
|
606
|
+
return self._alloc(logger_callback, host, port, transport_kind)
|
607
|
+
|
608
|
+
def open(
|
609
|
+
self, ptr: DriverPointer, operation_id: OperationIdPointer, cancel: CancelPointer
|
610
|
+
) -> int:
|
611
|
+
"""
|
612
|
+
Open the driver at ptr.
|
613
|
+
|
614
|
+
Should (generally) not be called directly/by users.
|
615
|
+
|
616
|
+
Args:
|
617
|
+
ptr: the ptr to the libscrapli netconf object.
|
618
|
+
operation_id: c_int pointer that is filled with the operation id to poll for completion.
|
619
|
+
cancel: bool pointer that can be set to true to cancel the operation.
|
620
|
+
|
621
|
+
Returns:
|
622
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
623
|
+
ctypes.
|
624
|
+
|
625
|
+
Raises:
|
626
|
+
N/A
|
627
|
+
|
628
|
+
"""
|
629
|
+
return self._open(ptr, operation_id, cancel)
|
630
|
+
|
631
|
+
def close(
|
632
|
+
self,
|
633
|
+
ptr: DriverPointer,
|
634
|
+
operation_id: OperationIdPointer,
|
635
|
+
cancel: CancelPointer,
|
636
|
+
force: c_bool,
|
637
|
+
) -> int:
|
638
|
+
"""
|
639
|
+
Close the driver at ptr.
|
640
|
+
|
641
|
+
Should (generally) not be called directly/by users.
|
642
|
+
|
643
|
+
Args:
|
644
|
+
ptr: the ptr to the libscrapli netconf object.
|
645
|
+
operation_id: c_int pointer that is filled with the operation id to poll for completion.
|
646
|
+
cancel: bool pointer that can be set to true to cancel the operation.
|
647
|
+
force: bool indicating if the connection should skip sending close-session rpc or not
|
648
|
+
|
649
|
+
Returns:
|
650
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
651
|
+
ctypes.
|
652
|
+
|
653
|
+
Raises:
|
654
|
+
N/A
|
655
|
+
|
656
|
+
"""
|
657
|
+
return self._close(
|
658
|
+
ptr,
|
659
|
+
operation_id,
|
660
|
+
cancel,
|
661
|
+
force,
|
662
|
+
)
|
663
|
+
|
664
|
+
def fetch_sizes(
|
665
|
+
self,
|
666
|
+
*,
|
667
|
+
ptr: DriverPointer,
|
668
|
+
operation_id: OperationId,
|
669
|
+
input_size: IntPointer,
|
670
|
+
result_raw_size: IntPointer,
|
671
|
+
result_size: IntPointer,
|
672
|
+
rpc_warnings_size: IntPointer,
|
673
|
+
rpc_errors_size: IntPointer,
|
674
|
+
err_size: IntPointer,
|
675
|
+
) -> int:
|
676
|
+
"""
|
677
|
+
Fetch the sizes of a netconf operation's results.
|
678
|
+
|
679
|
+
Should (generally) not be called directly/by users.
|
680
|
+
|
681
|
+
Args:
|
682
|
+
ptr: ptr to the netconf object
|
683
|
+
operation_id: operation id of which to poll
|
684
|
+
input_size: int pointer to fill with the operation's input size
|
685
|
+
result_raw_size: int pointer to fill with the operation's result raw size
|
686
|
+
result_size: int pointer to fill with the operation's result size
|
687
|
+
rpc_warnings_size: int pointer to fill with the size of any rpc warning string
|
688
|
+
rpc_errors_size: int pointer to fill with the size of any rpc error string
|
689
|
+
err_size: int pointer to fill with the operation's error size
|
690
|
+
|
691
|
+
Returns:
|
692
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
693
|
+
ctypes.
|
694
|
+
|
695
|
+
Raises:
|
696
|
+
N/A
|
697
|
+
|
698
|
+
"""
|
699
|
+
return self._fetch_sizes(
|
700
|
+
ptr,
|
701
|
+
operation_id,
|
702
|
+
input_size,
|
703
|
+
result_raw_size,
|
704
|
+
result_size,
|
705
|
+
rpc_warnings_size,
|
706
|
+
rpc_errors_size,
|
707
|
+
err_size,
|
708
|
+
)
|
709
|
+
|
710
|
+
def fetch(
|
711
|
+
self,
|
712
|
+
*,
|
713
|
+
ptr: DriverPointer,
|
714
|
+
operation_id: OperationId,
|
715
|
+
start_time: U64Pointer,
|
716
|
+
end_time: U64Pointer,
|
717
|
+
input_slice: ZigSlicePointer,
|
718
|
+
result_raw_slice: ZigSlicePointer,
|
719
|
+
result_slice: ZigSlicePointer,
|
720
|
+
rpc_warnings_slice: ZigSlicePointer,
|
721
|
+
rpc_errors_slice: ZigSlicePointer,
|
722
|
+
err_slice: ZigSlicePointer,
|
723
|
+
) -> int:
|
724
|
+
"""
|
725
|
+
Fetch the result of a cli operation.
|
726
|
+
|
727
|
+
Should (generally) not be called directly/by users.
|
728
|
+
|
729
|
+
Args:
|
730
|
+
ptr: ptr to the netconf object
|
731
|
+
operation_id: operation id of which to poll
|
732
|
+
start_time: int pointer to fill with the operation's start time
|
733
|
+
end_time: int pointer to fill with the operation's end time
|
734
|
+
input_slice: pre allocated slice to fill with the operations input
|
735
|
+
result_raw_slice: pre allocated slice to fill with the operations result raw
|
736
|
+
result_slice: pre allocated slice to fill with the operations result
|
737
|
+
rpc_warnings_slice: pre allocated slice to fill with the rpc warnings string
|
738
|
+
rpc_errors_slice: pre allocated slice to fill with the rpc errors string
|
739
|
+
err_slice: pre allocated slice to fill with the operations error
|
740
|
+
|
741
|
+
Returns:
|
742
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
743
|
+
ctypes.
|
744
|
+
|
745
|
+
Raises:
|
746
|
+
N/A
|
747
|
+
|
748
|
+
"""
|
749
|
+
return self._fetch(
|
750
|
+
ptr,
|
751
|
+
operation_id,
|
752
|
+
start_time,
|
753
|
+
end_time,
|
754
|
+
input_slice,
|
755
|
+
result_raw_slice,
|
756
|
+
result_slice,
|
757
|
+
rpc_warnings_slice,
|
758
|
+
rpc_errors_slice,
|
759
|
+
err_slice,
|
760
|
+
)
|
761
|
+
|
762
|
+
def get_session_id(
|
763
|
+
self,
|
764
|
+
*,
|
765
|
+
ptr: DriverPointer,
|
766
|
+
session_id: IntPointer,
|
767
|
+
) -> int:
|
768
|
+
"""
|
769
|
+
Get the session id of the Netconf object/session.
|
770
|
+
|
771
|
+
Should (generally) not be called directly/by users.
|
772
|
+
|
773
|
+
Args:
|
774
|
+
ptr: ptr to the netconf object
|
775
|
+
session_id: int pointer to fill with the session id
|
776
|
+
|
777
|
+
Returns:
|
778
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
779
|
+
ctypes.
|
780
|
+
|
781
|
+
Raises:
|
782
|
+
N/A
|
783
|
+
|
784
|
+
"""
|
785
|
+
return self._get_session_id(
|
786
|
+
ptr,
|
787
|
+
session_id,
|
788
|
+
)
|
789
|
+
|
790
|
+
def get_subscription_id(
|
791
|
+
self,
|
792
|
+
*,
|
793
|
+
payload: c_char_p,
|
794
|
+
subscription_id: U64Pointer,
|
795
|
+
) -> int:
|
796
|
+
"""
|
797
|
+
Get the subscription id from the given subscription response payload.
|
798
|
+
|
799
|
+
Should (generally) not be called directly/by users.
|
800
|
+
|
801
|
+
Args:
|
802
|
+
payload: payload to get the subscription id from
|
803
|
+
subscription_id: int pointer to fill with the subscription id
|
804
|
+
|
805
|
+
Returns:
|
806
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
807
|
+
ctypes.
|
808
|
+
|
809
|
+
Raises:
|
810
|
+
N/A
|
811
|
+
|
812
|
+
"""
|
813
|
+
return self._get_subscription_id(
|
814
|
+
payload,
|
815
|
+
subscription_id,
|
816
|
+
)
|
817
|
+
|
818
|
+
def get_next_notification_size(
|
819
|
+
self,
|
820
|
+
*,
|
821
|
+
ptr: DriverPointer,
|
822
|
+
notification_size: U64Pointer,
|
823
|
+
) -> int:
|
824
|
+
"""
|
825
|
+
Get the size of the next notification message.
|
826
|
+
|
827
|
+
Should (generally) not be called directly/by users.
|
828
|
+
|
829
|
+
Args:
|
830
|
+
ptr: ptr to the netconf object
|
831
|
+
notification_size: int pointer to fill with the session id
|
832
|
+
|
833
|
+
Returns:
|
834
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
835
|
+
ctypes.
|
836
|
+
|
837
|
+
Raises:
|
838
|
+
N/A
|
839
|
+
|
840
|
+
"""
|
841
|
+
return self._get_next_notification_size(
|
842
|
+
ptr,
|
843
|
+
notification_size,
|
844
|
+
)
|
845
|
+
|
846
|
+
def get_next_notification(
|
847
|
+
self,
|
848
|
+
*,
|
849
|
+
ptr: DriverPointer,
|
850
|
+
notification_slice: ZigSlicePointer,
|
851
|
+
) -> int:
|
852
|
+
"""
|
853
|
+
Get the next notification message.
|
854
|
+
|
855
|
+
Should (generally) not be called directly/by users.
|
856
|
+
|
857
|
+
Args:
|
858
|
+
ptr: ptr to the netconf object
|
859
|
+
notification_slice: pre populted slice to fill with the notification
|
860
|
+
|
861
|
+
Returns:
|
862
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
863
|
+
ctypes.
|
864
|
+
|
865
|
+
Raises:
|
866
|
+
N/A
|
867
|
+
|
868
|
+
"""
|
869
|
+
return self._get_next_notification(
|
870
|
+
ptr,
|
871
|
+
notification_slice,
|
872
|
+
)
|
873
|
+
|
874
|
+
def get_next_subscription_size(
|
875
|
+
self,
|
876
|
+
*,
|
877
|
+
ptr: DriverPointer,
|
878
|
+
subscription_id: c_uint64,
|
879
|
+
subscription_size: U64Pointer,
|
880
|
+
) -> int:
|
881
|
+
"""
|
882
|
+
Get the size of the next subscription message for the given id.
|
883
|
+
|
884
|
+
Should (generally) not be called directly/by users.
|
885
|
+
|
886
|
+
Args:
|
887
|
+
ptr: ptr to the netconf object
|
888
|
+
subscription_id: subscription id to fetch a message for
|
889
|
+
subscription_size: int pointer to fill with the session id
|
890
|
+
|
891
|
+
Returns:
|
892
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
893
|
+
ctypes.
|
894
|
+
|
895
|
+
Raises:
|
896
|
+
N/A
|
897
|
+
|
898
|
+
"""
|
899
|
+
return self._get_next_subscription_size(
|
900
|
+
ptr,
|
901
|
+
subscription_id,
|
902
|
+
subscription_size,
|
903
|
+
)
|
904
|
+
|
905
|
+
def get_next_subscription(
|
906
|
+
self,
|
907
|
+
*,
|
908
|
+
ptr: DriverPointer,
|
909
|
+
subscription_id: c_uint64,
|
910
|
+
subscription_slice: ZigSlicePointer,
|
911
|
+
) -> int:
|
912
|
+
"""
|
913
|
+
Get the next subscription message for the given id.
|
914
|
+
|
915
|
+
Should (generally) not be called directly/by users.
|
916
|
+
|
917
|
+
Args:
|
918
|
+
ptr: ptr to the netconf object
|
919
|
+
subscription_id: subscription id to fetch a message for
|
920
|
+
subscription_slice: pre populted slice to fill with the notification
|
921
|
+
|
922
|
+
Returns:
|
923
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
924
|
+
ctypes.
|
925
|
+
|
926
|
+
Raises:
|
927
|
+
N/A
|
928
|
+
|
929
|
+
"""
|
930
|
+
return self._get_next_subscription(
|
931
|
+
ptr,
|
932
|
+
subscription_id,
|
933
|
+
subscription_slice,
|
934
|
+
)
|
935
|
+
|
936
|
+
def raw_rpc(
|
937
|
+
self,
|
938
|
+
*,
|
939
|
+
ptr: DriverPointer,
|
940
|
+
operation_id: OperationIdPointer,
|
941
|
+
cancel: CancelPointer,
|
942
|
+
payload: c_char_p,
|
943
|
+
base_namespace_prefix: c_char_p,
|
944
|
+
extra_namespaces: c_char_p,
|
945
|
+
) -> int:
|
946
|
+
"""
|
947
|
+
Execute a "raw" / user defined rpc operation.
|
948
|
+
|
949
|
+
Should (generally) not be called directly/by users.
|
950
|
+
|
951
|
+
Args:
|
952
|
+
ptr: ptr to the netconf object
|
953
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
954
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
955
|
+
payload: the payload to write into the outer rpc element
|
956
|
+
base_namespace_prefix: prefix to use for hte base/default netconf base namespace
|
957
|
+
extra_namespaces: extra namespace::prefix pairs (using "::" as split there), and
|
958
|
+
split by "__libscrapli__" for additional pairs. this plus the base namespace
|
959
|
+
prefix can allow for weird cases like nxos where the base namespace must be
|
960
|
+
prefixed and then additional namespaces indicating desired targets must be added
|
961
|
+
|
962
|
+
Returns:
|
963
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
964
|
+
ctypes.
|
965
|
+
|
966
|
+
Raises:
|
967
|
+
N/A
|
968
|
+
|
969
|
+
"""
|
970
|
+
return self._raw_rpc(
|
971
|
+
ptr,
|
972
|
+
operation_id,
|
973
|
+
cancel,
|
974
|
+
payload,
|
975
|
+
base_namespace_prefix,
|
976
|
+
extra_namespaces,
|
977
|
+
)
|
978
|
+
|
979
|
+
def get_config(
|
980
|
+
self,
|
981
|
+
*,
|
982
|
+
ptr: DriverPointer,
|
983
|
+
operation_id: OperationIdPointer,
|
984
|
+
cancel: CancelPointer,
|
985
|
+
source: c_char_p,
|
986
|
+
filter_: c_char_p,
|
987
|
+
filter_type: c_char_p,
|
988
|
+
filter_namespace_prefix: c_char_p,
|
989
|
+
filter_namespace: c_char_p,
|
990
|
+
defaults_type: c_char_p,
|
991
|
+
) -> int:
|
992
|
+
"""
|
993
|
+
Execute a get-config rpc operation.
|
994
|
+
|
995
|
+
Should (generally) not be called directly/by users.
|
996
|
+
|
997
|
+
Args:
|
998
|
+
ptr: ptr to the netconf object
|
999
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1000
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1001
|
+
source: source data store to get config from
|
1002
|
+
filter_: filter to apply
|
1003
|
+
filter_type: filter type (subtree|xpath)
|
1004
|
+
filter_namespace_prefix: optional prefix for filter namespace
|
1005
|
+
filter_namespace: optional namespace for filter
|
1006
|
+
defaults_type: defaults type setting
|
1007
|
+
|
1008
|
+
Returns:
|
1009
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1010
|
+
ctypes.
|
1011
|
+
|
1012
|
+
Raises:
|
1013
|
+
N/A
|
1014
|
+
|
1015
|
+
"""
|
1016
|
+
return self._get_config(
|
1017
|
+
ptr,
|
1018
|
+
operation_id,
|
1019
|
+
cancel,
|
1020
|
+
source,
|
1021
|
+
filter_,
|
1022
|
+
filter_type,
|
1023
|
+
filter_namespace_prefix,
|
1024
|
+
filter_namespace,
|
1025
|
+
defaults_type,
|
1026
|
+
)
|
1027
|
+
|
1028
|
+
def edit_config(
|
1029
|
+
self,
|
1030
|
+
*,
|
1031
|
+
ptr: DriverPointer,
|
1032
|
+
operation_id: OperationIdPointer,
|
1033
|
+
cancel: CancelPointer,
|
1034
|
+
config: c_char_p,
|
1035
|
+
target: c_char_p,
|
1036
|
+
) -> int:
|
1037
|
+
"""
|
1038
|
+
Execute an edit-config rpc operation.
|
1039
|
+
|
1040
|
+
Should (generally) not be called directly/by users.
|
1041
|
+
|
1042
|
+
Args:
|
1043
|
+
ptr: ptr to the netconf object
|
1044
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1045
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1046
|
+
config: the config to send
|
1047
|
+
target: the target datastore
|
1048
|
+
|
1049
|
+
Returns:
|
1050
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1051
|
+
ctypes.
|
1052
|
+
|
1053
|
+
Raises:
|
1054
|
+
N/A
|
1055
|
+
|
1056
|
+
"""
|
1057
|
+
return self._edit_config(
|
1058
|
+
ptr,
|
1059
|
+
operation_id,
|
1060
|
+
cancel,
|
1061
|
+
config,
|
1062
|
+
target,
|
1063
|
+
)
|
1064
|
+
|
1065
|
+
def copy_config(
|
1066
|
+
self,
|
1067
|
+
*,
|
1068
|
+
ptr: DriverPointer,
|
1069
|
+
operation_id: OperationIdPointer,
|
1070
|
+
cancel: CancelPointer,
|
1071
|
+
target: c_char_p,
|
1072
|
+
source: c_char_p,
|
1073
|
+
) -> int:
|
1074
|
+
"""
|
1075
|
+
Execute a copy-config rpc operation.
|
1076
|
+
|
1077
|
+
Should (generally) not be called directly/by users.
|
1078
|
+
|
1079
|
+
Args:
|
1080
|
+
ptr: ptr to the netconf object
|
1081
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1082
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1083
|
+
target: the target/destination datastore to copy to
|
1084
|
+
source: the source datastore to copy from
|
1085
|
+
|
1086
|
+
Returns:
|
1087
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1088
|
+
ctypes.
|
1089
|
+
|
1090
|
+
Raises:
|
1091
|
+
N/A
|
1092
|
+
|
1093
|
+
"""
|
1094
|
+
return self._copy_config(
|
1095
|
+
ptr,
|
1096
|
+
operation_id,
|
1097
|
+
cancel,
|
1098
|
+
target,
|
1099
|
+
source,
|
1100
|
+
)
|
1101
|
+
|
1102
|
+
def delete_config(
|
1103
|
+
self,
|
1104
|
+
*,
|
1105
|
+
ptr: DriverPointer,
|
1106
|
+
operation_id: OperationIdPointer,
|
1107
|
+
cancel: CancelPointer,
|
1108
|
+
target: c_char_p,
|
1109
|
+
) -> int:
|
1110
|
+
"""
|
1111
|
+
Execute a delete-config rpc operation.
|
1112
|
+
|
1113
|
+
Should (generally) not be called directly/by users.
|
1114
|
+
|
1115
|
+
Args:
|
1116
|
+
ptr: ptr to the netconf object
|
1117
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1118
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1119
|
+
target: the target/destination datastore to delete
|
1120
|
+
|
1121
|
+
Returns:
|
1122
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1123
|
+
ctypes.
|
1124
|
+
|
1125
|
+
Raises:
|
1126
|
+
N/A
|
1127
|
+
|
1128
|
+
"""
|
1129
|
+
return self._delete_config(
|
1130
|
+
ptr,
|
1131
|
+
operation_id,
|
1132
|
+
cancel,
|
1133
|
+
target,
|
1134
|
+
)
|
1135
|
+
|
1136
|
+
def lock(
|
1137
|
+
self,
|
1138
|
+
*,
|
1139
|
+
ptr: DriverPointer,
|
1140
|
+
operation_id: OperationIdPointer,
|
1141
|
+
cancel: CancelPointer,
|
1142
|
+
target: c_char_p,
|
1143
|
+
) -> int:
|
1144
|
+
"""
|
1145
|
+
Execute a lock rpc operation.
|
1146
|
+
|
1147
|
+
Should (generally) not be called directly/by users.
|
1148
|
+
|
1149
|
+
Args:
|
1150
|
+
ptr: ptr to the netconf object
|
1151
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1152
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1153
|
+
target: the target/destination datastore to lock
|
1154
|
+
|
1155
|
+
Returns:
|
1156
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1157
|
+
ctypes.
|
1158
|
+
|
1159
|
+
Raises:
|
1160
|
+
N/A
|
1161
|
+
|
1162
|
+
"""
|
1163
|
+
return self._lock(
|
1164
|
+
ptr,
|
1165
|
+
operation_id,
|
1166
|
+
cancel,
|
1167
|
+
target,
|
1168
|
+
)
|
1169
|
+
|
1170
|
+
def unlock(
|
1171
|
+
self,
|
1172
|
+
*,
|
1173
|
+
ptr: DriverPointer,
|
1174
|
+
operation_id: OperationIdPointer,
|
1175
|
+
cancel: CancelPointer,
|
1176
|
+
target: c_char_p,
|
1177
|
+
) -> int:
|
1178
|
+
"""
|
1179
|
+
Execute an unlock rpc operation.
|
1180
|
+
|
1181
|
+
Should (generally) not be called directly/by users.
|
1182
|
+
|
1183
|
+
Args:
|
1184
|
+
ptr: ptr to the netconf object
|
1185
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1186
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1187
|
+
target: the target/destination datastore to lock
|
1188
|
+
|
1189
|
+
Returns:
|
1190
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1191
|
+
ctypes.
|
1192
|
+
|
1193
|
+
Raises:
|
1194
|
+
N/A
|
1195
|
+
|
1196
|
+
"""
|
1197
|
+
return self._unlock(
|
1198
|
+
ptr,
|
1199
|
+
operation_id,
|
1200
|
+
cancel,
|
1201
|
+
target,
|
1202
|
+
)
|
1203
|
+
|
1204
|
+
def get(
|
1205
|
+
self,
|
1206
|
+
*,
|
1207
|
+
ptr: DriverPointer,
|
1208
|
+
operation_id: OperationIdPointer,
|
1209
|
+
cancel: CancelPointer,
|
1210
|
+
filter_: c_char_p,
|
1211
|
+
filter_type: c_char_p,
|
1212
|
+
filter_namespace_prefix: c_char_p,
|
1213
|
+
filter_namespace: c_char_p,
|
1214
|
+
defaults_type: c_char_p,
|
1215
|
+
) -> int:
|
1216
|
+
"""
|
1217
|
+
Execute a get rpc operation.
|
1218
|
+
|
1219
|
+
Should (generally) not be called directly/by users.
|
1220
|
+
|
1221
|
+
Args:
|
1222
|
+
ptr: ptr to the netconf object
|
1223
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1224
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1225
|
+
filter_: filter to apply
|
1226
|
+
filter_type: filter type (subtree|xpath)
|
1227
|
+
filter_namespace_prefix: optional prefix for filter namespace
|
1228
|
+
filter_namespace: optional namespace for filter
|
1229
|
+
defaults_type: defaults type setting
|
1230
|
+
|
1231
|
+
Returns:
|
1232
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1233
|
+
ctypes.
|
1234
|
+
|
1235
|
+
Raises:
|
1236
|
+
N/A
|
1237
|
+
|
1238
|
+
"""
|
1239
|
+
return self._get(
|
1240
|
+
ptr,
|
1241
|
+
operation_id,
|
1242
|
+
cancel,
|
1243
|
+
filter_,
|
1244
|
+
filter_type,
|
1245
|
+
filter_namespace_prefix,
|
1246
|
+
filter_namespace,
|
1247
|
+
defaults_type,
|
1248
|
+
)
|
1249
|
+
|
1250
|
+
def close_session(
|
1251
|
+
self,
|
1252
|
+
*,
|
1253
|
+
ptr: DriverPointer,
|
1254
|
+
operation_id: OperationIdPointer,
|
1255
|
+
cancel: CancelPointer,
|
1256
|
+
) -> int:
|
1257
|
+
"""
|
1258
|
+
Execute a close-config rpc operation.
|
1259
|
+
|
1260
|
+
Should (generally) not be called directly/by users.
|
1261
|
+
|
1262
|
+
Args:
|
1263
|
+
ptr: ptr to the netconf object
|
1264
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1265
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1266
|
+
|
1267
|
+
Returns:
|
1268
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1269
|
+
ctypes.
|
1270
|
+
|
1271
|
+
Raises:
|
1272
|
+
N/A
|
1273
|
+
|
1274
|
+
"""
|
1275
|
+
return self._close_session(
|
1276
|
+
ptr,
|
1277
|
+
operation_id,
|
1278
|
+
cancel,
|
1279
|
+
)
|
1280
|
+
|
1281
|
+
def kill_session(
|
1282
|
+
self,
|
1283
|
+
*,
|
1284
|
+
ptr: DriverPointer,
|
1285
|
+
operation_id: OperationIdPointer,
|
1286
|
+
cancel: CancelPointer,
|
1287
|
+
session_id: c_int,
|
1288
|
+
) -> int:
|
1289
|
+
"""
|
1290
|
+
Execute a close-config rpc operation.
|
1291
|
+
|
1292
|
+
Should (generally) not be called directly/by users.
|
1293
|
+
|
1294
|
+
Args:
|
1295
|
+
ptr: ptr to the netconf object
|
1296
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1297
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1298
|
+
session_id: the session id to kill
|
1299
|
+
|
1300
|
+
Returns:
|
1301
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1302
|
+
ctypes.
|
1303
|
+
|
1304
|
+
Raises:
|
1305
|
+
N/A
|
1306
|
+
|
1307
|
+
"""
|
1308
|
+
return self._kill_session(
|
1309
|
+
ptr,
|
1310
|
+
operation_id,
|
1311
|
+
cancel,
|
1312
|
+
session_id,
|
1313
|
+
)
|
1314
|
+
|
1315
|
+
def commit(
|
1316
|
+
self,
|
1317
|
+
*,
|
1318
|
+
ptr: DriverPointer,
|
1319
|
+
operation_id: OperationIdPointer,
|
1320
|
+
cancel: CancelPointer,
|
1321
|
+
) -> int:
|
1322
|
+
"""
|
1323
|
+
Execute a commit rpc operation.
|
1324
|
+
|
1325
|
+
Should (generally) not be called directly/by users.
|
1326
|
+
|
1327
|
+
Args:
|
1328
|
+
ptr: ptr to the netconf object
|
1329
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1330
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1331
|
+
|
1332
|
+
Returns:
|
1333
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1334
|
+
ctypes.
|
1335
|
+
|
1336
|
+
Raises:
|
1337
|
+
N/A
|
1338
|
+
|
1339
|
+
"""
|
1340
|
+
return self._commit(
|
1341
|
+
ptr,
|
1342
|
+
operation_id,
|
1343
|
+
cancel,
|
1344
|
+
)
|
1345
|
+
|
1346
|
+
def discard(
|
1347
|
+
self,
|
1348
|
+
*,
|
1349
|
+
ptr: DriverPointer,
|
1350
|
+
operation_id: OperationIdPointer,
|
1351
|
+
cancel: CancelPointer,
|
1352
|
+
) -> int:
|
1353
|
+
"""
|
1354
|
+
Execute a discard rpc operation.
|
1355
|
+
|
1356
|
+
Should (generally) not be called directly/by users.
|
1357
|
+
|
1358
|
+
Args:
|
1359
|
+
ptr: ptr to the netconf object
|
1360
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1361
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1362
|
+
|
1363
|
+
Returns:
|
1364
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1365
|
+
ctypes.
|
1366
|
+
|
1367
|
+
Raises:
|
1368
|
+
N/A
|
1369
|
+
|
1370
|
+
"""
|
1371
|
+
return self._discard(
|
1372
|
+
ptr,
|
1373
|
+
operation_id,
|
1374
|
+
cancel,
|
1375
|
+
)
|
1376
|
+
|
1377
|
+
def cancel_commit(
|
1378
|
+
self,
|
1379
|
+
*,
|
1380
|
+
ptr: DriverPointer,
|
1381
|
+
operation_id: OperationIdPointer,
|
1382
|
+
cancel: CancelPointer,
|
1383
|
+
) -> int:
|
1384
|
+
"""
|
1385
|
+
Execute a cancel-commit rpc operation.
|
1386
|
+
|
1387
|
+
Should (generally) not be called directly/by users.
|
1388
|
+
|
1389
|
+
Args:
|
1390
|
+
ptr: ptr to the netconf object
|
1391
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1392
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1393
|
+
|
1394
|
+
Returns:
|
1395
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1396
|
+
ctypes.
|
1397
|
+
|
1398
|
+
Raises:
|
1399
|
+
N/A
|
1400
|
+
|
1401
|
+
"""
|
1402
|
+
return self._cancel_commit(
|
1403
|
+
ptr,
|
1404
|
+
operation_id,
|
1405
|
+
cancel,
|
1406
|
+
)
|
1407
|
+
|
1408
|
+
def validate(
|
1409
|
+
self,
|
1410
|
+
*,
|
1411
|
+
ptr: DriverPointer,
|
1412
|
+
operation_id: OperationIdPointer,
|
1413
|
+
cancel: CancelPointer,
|
1414
|
+
source: c_char_p,
|
1415
|
+
) -> int:
|
1416
|
+
"""
|
1417
|
+
Execute a validate rpc operation.
|
1418
|
+
|
1419
|
+
Should (generally) not be called directly/by users.
|
1420
|
+
|
1421
|
+
Args:
|
1422
|
+
ptr: ptr to the netconf object
|
1423
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1424
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1425
|
+
source: datastore to validate
|
1426
|
+
|
1427
|
+
Returns:
|
1428
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1429
|
+
ctypes.
|
1430
|
+
|
1431
|
+
Raises:
|
1432
|
+
N/A
|
1433
|
+
|
1434
|
+
"""
|
1435
|
+
return self._validate(
|
1436
|
+
ptr,
|
1437
|
+
operation_id,
|
1438
|
+
cancel,
|
1439
|
+
source,
|
1440
|
+
)
|
1441
|
+
|
1442
|
+
def get_schema(
|
1443
|
+
self,
|
1444
|
+
*,
|
1445
|
+
ptr: DriverPointer,
|
1446
|
+
operation_id: OperationIdPointer,
|
1447
|
+
cancel: CancelPointer,
|
1448
|
+
identifier: c_char_p,
|
1449
|
+
version: c_char_p,
|
1450
|
+
format_: c_char_p,
|
1451
|
+
) -> int:
|
1452
|
+
"""
|
1453
|
+
Execute a get-schema rpc operation.
|
1454
|
+
|
1455
|
+
Should (generally) not be called directly/by users.
|
1456
|
+
|
1457
|
+
Args:
|
1458
|
+
ptr: ptr to the netconf object
|
1459
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1460
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1461
|
+
identifier: schema identifier to get
|
1462
|
+
version: optional schema version to request
|
1463
|
+
format_: schema format to apply
|
1464
|
+
|
1465
|
+
Returns:
|
1466
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1467
|
+
ctypes.
|
1468
|
+
|
1469
|
+
Raises:
|
1470
|
+
N/A
|
1471
|
+
|
1472
|
+
"""
|
1473
|
+
return self._get_schema(
|
1474
|
+
ptr,
|
1475
|
+
operation_id,
|
1476
|
+
cancel,
|
1477
|
+
identifier,
|
1478
|
+
version,
|
1479
|
+
format_,
|
1480
|
+
)
|
1481
|
+
|
1482
|
+
def get_data(
|
1483
|
+
self,
|
1484
|
+
*,
|
1485
|
+
ptr: DriverPointer,
|
1486
|
+
operation_id: OperationIdPointer,
|
1487
|
+
cancel: CancelPointer,
|
1488
|
+
source: c_char_p,
|
1489
|
+
filter_: c_char_p,
|
1490
|
+
filter_type: c_char_p,
|
1491
|
+
filter_namespace_prefix: c_char_p,
|
1492
|
+
filter_namespace: c_char_p,
|
1493
|
+
config_filter: c_char_p,
|
1494
|
+
origin_filters: c_char_p,
|
1495
|
+
max_depth: c_int,
|
1496
|
+
with_origin: c_bool,
|
1497
|
+
defaults_type: c_char_p,
|
1498
|
+
) -> int:
|
1499
|
+
"""
|
1500
|
+
Execute a get-data rpc operation.
|
1501
|
+
|
1502
|
+
Should (generally) not be called directly/by users.
|
1503
|
+
|
1504
|
+
Args:
|
1505
|
+
ptr: ptr to the netconf object
|
1506
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1507
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1508
|
+
source: source datastore to get data from
|
1509
|
+
filter_: filter to apply to the get-config (or not if empty string)
|
1510
|
+
filter_type: type of filter to apply, subtree|xpath
|
1511
|
+
filter_namespace_prefix: filter namespace prefix
|
1512
|
+
filter_namespace: filter namespace
|
1513
|
+
config_filter: config filter true/false, or unset to leave up to the server
|
1514
|
+
origin_filters: fully formed origin filter xml payload to embed
|
1515
|
+
max_depth: max depth of data requested
|
1516
|
+
with_origin: include origin data
|
1517
|
+
defaults_type: defaults type to apply to the get-config, "unset" means dont apply one
|
1518
|
+
|
1519
|
+
Returns:
|
1520
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1521
|
+
ctypes.
|
1522
|
+
|
1523
|
+
Raises:
|
1524
|
+
N/A
|
1525
|
+
|
1526
|
+
"""
|
1527
|
+
return self._get_data(
|
1528
|
+
ptr,
|
1529
|
+
operation_id,
|
1530
|
+
cancel,
|
1531
|
+
source,
|
1532
|
+
filter_,
|
1533
|
+
filter_type,
|
1534
|
+
filter_namespace_prefix,
|
1535
|
+
filter_namespace,
|
1536
|
+
config_filter,
|
1537
|
+
origin_filters,
|
1538
|
+
max_depth,
|
1539
|
+
with_origin,
|
1540
|
+
defaults_type,
|
1541
|
+
)
|
1542
|
+
|
1543
|
+
def edit_data(
|
1544
|
+
self,
|
1545
|
+
*,
|
1546
|
+
ptr: DriverPointer,
|
1547
|
+
operation_id: OperationIdPointer,
|
1548
|
+
cancel: CancelPointer,
|
1549
|
+
target: c_char_p,
|
1550
|
+
content: c_char_p,
|
1551
|
+
) -> int:
|
1552
|
+
"""
|
1553
|
+
Execute a edit-data rpc operation.
|
1554
|
+
|
1555
|
+
Should (generally) not be called directly/by users.
|
1556
|
+
|
1557
|
+
Args:
|
1558
|
+
ptr: ptr to the netconf object
|
1559
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1560
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1561
|
+
target: datastore to target
|
1562
|
+
content: full payload content to send
|
1563
|
+
|
1564
|
+
Returns:
|
1565
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1566
|
+
ctypes.
|
1567
|
+
|
1568
|
+
Raises:
|
1569
|
+
N/A
|
1570
|
+
|
1571
|
+
"""
|
1572
|
+
return self._edit_data(
|
1573
|
+
ptr,
|
1574
|
+
operation_id,
|
1575
|
+
cancel,
|
1576
|
+
target,
|
1577
|
+
content,
|
1578
|
+
)
|
1579
|
+
|
1580
|
+
def action(
|
1581
|
+
self,
|
1582
|
+
*,
|
1583
|
+
ptr: DriverPointer,
|
1584
|
+
operation_id: OperationIdPointer,
|
1585
|
+
cancel: CancelPointer,
|
1586
|
+
action: c_char_p,
|
1587
|
+
) -> int:
|
1588
|
+
"""
|
1589
|
+
Execute an action rpc operation.
|
1590
|
+
|
1591
|
+
Should (generally) not be called directly/by users.
|
1592
|
+
|
1593
|
+
Args:
|
1594
|
+
ptr: ptr to the netconf object
|
1595
|
+
operation_id: int pointer to fill with the id of the submitted operation
|
1596
|
+
cancel: bool pointer that can be set to true to cancel the operation
|
1597
|
+
action: the action to send
|
1598
|
+
|
1599
|
+
Returns:
|
1600
|
+
int: return code, non-zero value indicates an error. technically a c_uint8 converted by
|
1601
|
+
ctypes.
|
1602
|
+
|
1603
|
+
Raises:
|
1604
|
+
N/A
|
1605
|
+
|
1606
|
+
"""
|
1607
|
+
return self._action(
|
1608
|
+
ptr,
|
1609
|
+
operation_id,
|
1610
|
+
cancel,
|
1611
|
+
action,
|
1612
|
+
)
|