scrapli 2.0.0a2__py3-none-macosx_11_0_arm64.whl → 2.0.0a4__py3-none-macosx_11_0_arm64.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 +2 -1
- scrapli/cli.py +34 -66
- scrapli/ffi.py +1 -1
- scrapli/ffi_mapping.py +3 -4
- scrapli/ffi_mapping_cli.py +42 -22
- scrapli/ffi_mapping_netconf.py +28 -60
- scrapli/ffi_types.py +42 -2
- scrapli/lib/libscrapli.0.0.1-alpha.13.dylib +0 -0
- scrapli/netconf.py +36 -147
- scrapli/transport.py +71 -130
- {scrapli-2.0.0a2.dist-info → scrapli-2.0.0a4.dist-info}/METADATA +1 -1
- {scrapli-2.0.0a2.dist-info → scrapli-2.0.0a4.dist-info}/RECORD +15 -15
- scrapli/lib/libscrapli.0.0.1-alpha.10.dylib +0 -0
- {scrapli-2.0.0a2.dist-info → scrapli-2.0.0a4.dist-info}/WHEEL +0 -0
- {scrapli-2.0.0a2.dist-info → scrapli-2.0.0a4.dist-info}/licenses/LICENSE +0 -0
- {scrapli-2.0.0a2.dist-info → scrapli-2.0.0a4.dist-info}/top_level.txt +0 -0
scrapli/netconf.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"""scrapli.netconf"""
|
2
2
|
|
3
|
-
from collections.abc import Callable
|
4
3
|
from ctypes import c_bool, c_char_p, c_int, c_uint, c_uint64
|
5
4
|
from dataclasses import dataclass, field
|
6
5
|
from enum import Enum
|
@@ -22,13 +21,12 @@ from scrapli.exceptions import (
|
|
22
21
|
)
|
23
22
|
from scrapli.ffi_mapping import LibScrapliMapping
|
24
23
|
from scrapli.ffi_types import (
|
25
|
-
CancelPointer,
|
26
24
|
DriverPointer,
|
27
25
|
IntPointer,
|
28
|
-
LogFuncCallback,
|
29
26
|
OperationIdPointer,
|
30
27
|
U64Pointer,
|
31
28
|
ZigSlice,
|
29
|
+
ffi_logger_wrapper,
|
32
30
|
to_c_string,
|
33
31
|
)
|
34
32
|
from scrapli.helper import (
|
@@ -38,6 +36,7 @@ from scrapli.helper import (
|
|
38
36
|
from scrapli.netconf_decorators import handle_operation_timeout, handle_operation_timeout_async
|
39
37
|
from scrapli.netconf_result import Result
|
40
38
|
from scrapli.session import Options as SessionOptions
|
39
|
+
from scrapli.transport import BinOptions as TransportBinOptions
|
41
40
|
from scrapli.transport import Options as TransportOptions
|
42
41
|
|
43
42
|
|
@@ -281,7 +280,6 @@ class Netconf:
|
|
281
280
|
self,
|
282
281
|
host: str,
|
283
282
|
*,
|
284
|
-
logger_callback: Callable[[int, str], None] | None = None,
|
285
283
|
port: int = 830,
|
286
284
|
options: Options | None = None,
|
287
285
|
auth_options: AuthOptions | None = None,
|
@@ -294,6 +292,7 @@ class Netconf:
|
|
294
292
|
logger_name += f":{logging_uid}"
|
295
293
|
|
296
294
|
self.logger = getLogger(logger_name)
|
295
|
+
self.logger_callback = ffi_logger_wrapper(logger=self.logger)
|
297
296
|
self._logging_uid = logging_uid
|
298
297
|
|
299
298
|
self.ffi_mapping = LibScrapliMapping()
|
@@ -301,19 +300,16 @@ class Netconf:
|
|
301
300
|
self.host = host
|
302
301
|
self._host = to_c_string(host)
|
303
302
|
|
304
|
-
self.logger_callback = (
|
305
|
-
LogFuncCallback(logger_callback) if logger_callback else LogFuncCallback(0)
|
306
|
-
)
|
307
|
-
self._logger_callback = logger_callback
|
308
|
-
|
309
303
|
self.port = port
|
310
304
|
|
311
305
|
self.options = options or Options()
|
312
306
|
self.auth_options = auth_options or AuthOptions()
|
313
307
|
self.session_options = session_options or SessionOptions()
|
314
|
-
self.transport_options = transport_options or
|
308
|
+
self.transport_options = transport_options or TransportBinOptions()
|
315
309
|
|
316
310
|
self.ptr: DriverPointer | None = None
|
311
|
+
self.poll_fd: int = 0
|
312
|
+
|
317
313
|
self._session_id: int | None = None
|
318
314
|
|
319
315
|
def __enter__(self: "Netconf") -> "Netconf":
|
@@ -447,7 +443,6 @@ class Netconf:
|
|
447
443
|
# will never be mutated during an objects lifetime, which *should* be the case. probably.
|
448
444
|
return Netconf(
|
449
445
|
host=self.host,
|
450
|
-
logger_callback=self._logger_callback,
|
451
446
|
port=self.port,
|
452
447
|
options=self.options,
|
453
448
|
auth_options=self.auth_options,
|
@@ -469,7 +464,7 @@ class Netconf:
|
|
469
464
|
logger_callback=self.logger_callback,
|
470
465
|
host=self._host,
|
471
466
|
port=c_int(self.port),
|
472
|
-
transport_kind=c_char_p(self.transport_options.
|
467
|
+
transport_kind=c_char_p(self.transport_options.transport_kind.encode(encoding="utf-8")),
|
473
468
|
)
|
474
469
|
if ptr == 0: # type: ignore[comparison-overlap]
|
475
470
|
raise AllocationException("failed to allocate netconf")
|
@@ -481,7 +476,7 @@ class Netconf:
|
|
481
476
|
ptr=self._ptr_or_exception(),
|
482
477
|
)
|
483
478
|
)
|
484
|
-
if poll_fd
|
479
|
+
if poll_fd <= 0:
|
485
480
|
raise AllocationException("failed to allocate netconf")
|
486
481
|
|
487
482
|
self.poll_fd = poll_fd
|
@@ -491,7 +486,11 @@ class Netconf:
|
|
491
486
|
) -> None:
|
492
487
|
self.ffi_mapping.shared_mapping.free(ptr=self._ptr_or_exception())
|
493
488
|
|
494
|
-
def _open(
|
489
|
+
def _open(
|
490
|
+
self,
|
491
|
+
*,
|
492
|
+
operation_id: OperationIdPointer,
|
493
|
+
) -> None:
|
495
494
|
self._alloc()
|
496
495
|
|
497
496
|
self.options.apply(self.ffi_mapping, self._ptr_or_exception())
|
@@ -499,22 +498,15 @@ class Netconf:
|
|
499
498
|
self.session_options.apply(self.ffi_mapping, self._ptr_or_exception())
|
500
499
|
self.transport_options.apply(self.ffi_mapping, self._ptr_or_exception())
|
501
500
|
|
502
|
-
operation_id = OperationIdPointer(c_uint(0))
|
503
|
-
cancel = CancelPointer(c_bool(False))
|
504
|
-
|
505
501
|
status = self.ffi_mapping.netconf_mapping.open(
|
506
502
|
ptr=self._ptr_or_exception(),
|
507
503
|
operation_id=operation_id,
|
508
|
-
cancel=cancel,
|
509
504
|
)
|
510
505
|
if status != 0:
|
511
506
|
self._free()
|
512
507
|
|
513
508
|
raise OpenException("failed to submit open operation")
|
514
509
|
|
515
|
-
# cast it again, for mypy reasons
|
516
|
-
return c_uint(operation_id.contents.value)
|
517
|
-
|
518
510
|
def open(
|
519
511
|
self,
|
520
512
|
) -> Result:
|
@@ -531,9 +523,11 @@ class Netconf:
|
|
531
523
|
OpenException: if the operation fails
|
532
524
|
|
533
525
|
"""
|
534
|
-
operation_id =
|
526
|
+
operation_id = OperationIdPointer(c_uint(0))
|
535
527
|
|
536
|
-
|
528
|
+
self._open(operation_id=operation_id)
|
529
|
+
|
530
|
+
return self._get_result(operation_id=operation_id.contents.value)
|
537
531
|
|
538
532
|
async def open_async(self) -> Result:
|
539
533
|
"""
|
@@ -549,29 +543,26 @@ class Netconf:
|
|
549
543
|
OpenException: if the operation fails
|
550
544
|
|
551
545
|
"""
|
552
|
-
operation_id =
|
546
|
+
operation_id = OperationIdPointer(c_uint(0))
|
553
547
|
|
554
|
-
|
548
|
+
self._open(operation_id=operation_id)
|
549
|
+
|
550
|
+
return await self._get_result_async(operation_id=operation_id.contents.value)
|
555
551
|
|
556
552
|
def _close(
|
557
553
|
self,
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
_force = c_bool(force)
|
563
|
-
|
554
|
+
*,
|
555
|
+
operation_id: OperationIdPointer,
|
556
|
+
force: c_bool,
|
557
|
+
) -> None:
|
564
558
|
status = self.ffi_mapping.netconf_mapping.close(
|
565
559
|
ptr=self._ptr_or_exception(),
|
566
560
|
operation_id=operation_id,
|
567
|
-
|
568
|
-
force=_force,
|
561
|
+
force=force,
|
569
562
|
)
|
570
563
|
if status != 0:
|
571
564
|
raise CloseException("submitting close operation")
|
572
565
|
|
573
|
-
return c_uint(operation_id.contents.value)
|
574
|
-
|
575
566
|
def close(
|
576
567
|
self,
|
577
568
|
*,
|
@@ -591,9 +582,12 @@ class Netconf:
|
|
591
582
|
CloseException: if the operation fails
|
592
583
|
|
593
584
|
"""
|
594
|
-
operation_id =
|
585
|
+
operation_id = OperationIdPointer(c_uint(0))
|
586
|
+
_force = c_bool(force)
|
595
587
|
|
596
|
-
|
588
|
+
self._close(operation_id=operation_id, force=_force)
|
589
|
+
|
590
|
+
result = self._get_result(operation_id=operation_id.contents.value)
|
597
591
|
|
598
592
|
self._free()
|
599
593
|
|
@@ -618,9 +612,12 @@ class Netconf:
|
|
618
612
|
CloseException: if the operation fails
|
619
613
|
|
620
614
|
"""
|
621
|
-
operation_id =
|
615
|
+
operation_id = OperationIdPointer(c_uint(0))
|
616
|
+
_force = c_bool(force)
|
617
|
+
|
618
|
+
self._close(operation_id=operation_id, force=_force)
|
622
619
|
|
623
|
-
result = await self._get_result_async(operation_id=operation_id)
|
620
|
+
result = await self._get_result_async(operation_id=operation_id.contents.value)
|
624
621
|
|
625
622
|
self._free()
|
626
623
|
|
@@ -905,7 +902,6 @@ class Netconf:
|
|
905
902
|
self,
|
906
903
|
*,
|
907
904
|
operation_id: OperationIdPointer,
|
908
|
-
cancel: CancelPointer,
|
909
905
|
payload: c_char_p,
|
910
906
|
base_namespace_prefix: c_char_p,
|
911
907
|
extra_namespaces: c_char_p,
|
@@ -913,7 +909,6 @@ class Netconf:
|
|
913
909
|
status = self.ffi_mapping.netconf_mapping.raw_rpc(
|
914
910
|
ptr=self._ptr_or_exception(),
|
915
911
|
operation_id=operation_id,
|
916
|
-
cancel=cancel,
|
917
912
|
payload=payload,
|
918
913
|
base_namespace_prefix=base_namespace_prefix,
|
919
914
|
extra_namespaces=extra_namespaces,
|
@@ -955,7 +950,6 @@ class Netconf:
|
|
955
950
|
_ = operation_timeout_ns
|
956
951
|
|
957
952
|
operation_id = OperationIdPointer(c_uint(0))
|
958
|
-
cancel = CancelPointer(c_bool(False))
|
959
953
|
|
960
954
|
_payload = to_c_string(payload)
|
961
955
|
_base_namespace_prefix = to_c_string(base_namespace_prefix)
|
@@ -969,7 +963,6 @@ class Netconf:
|
|
969
963
|
|
970
964
|
operation_id = self._raw_rpc(
|
971
965
|
operation_id=operation_id,
|
972
|
-
cancel=cancel,
|
973
966
|
payload=_payload,
|
974
967
|
base_namespace_prefix=_base_namespace_prefix,
|
975
968
|
extra_namespaces=_extra_namespaces,
|
@@ -1009,7 +1002,6 @@ class Netconf:
|
|
1009
1002
|
_ = operation_timeout_ns
|
1010
1003
|
|
1011
1004
|
operation_id = OperationIdPointer(c_uint(0))
|
1012
|
-
cancel = CancelPointer(c_bool(False))
|
1013
1005
|
|
1014
1006
|
_payload = to_c_string(payload)
|
1015
1007
|
_base_namespace_prefix = to_c_string(base_namespace_prefix)
|
@@ -1023,7 +1015,6 @@ class Netconf:
|
|
1023
1015
|
|
1024
1016
|
operation_id = self._raw_rpc(
|
1025
1017
|
operation_id=operation_id,
|
1026
|
-
cancel=cancel,
|
1027
1018
|
payload=_payload,
|
1028
1019
|
base_namespace_prefix=_base_namespace_prefix,
|
1029
1020
|
extra_namespaces=_extra_namespaces,
|
@@ -1035,7 +1026,6 @@ class Netconf:
|
|
1035
1026
|
self,
|
1036
1027
|
*,
|
1037
1028
|
operation_id: OperationIdPointer,
|
1038
|
-
cancel: CancelPointer,
|
1039
1029
|
source: c_char_p,
|
1040
1030
|
filter_: c_char_p,
|
1041
1031
|
filter_type: c_char_p,
|
@@ -1046,7 +1036,6 @@ class Netconf:
|
|
1046
1036
|
status = self.ffi_mapping.netconf_mapping.get_config(
|
1047
1037
|
ptr=self._ptr_or_exception(),
|
1048
1038
|
operation_id=operation_id,
|
1049
|
-
cancel=cancel,
|
1050
1039
|
source=source,
|
1051
1040
|
filter_=filter_,
|
1052
1041
|
filter_type=filter_type,
|
@@ -1095,7 +1084,6 @@ class Netconf:
|
|
1095
1084
|
_ = operation_timeout_ns
|
1096
1085
|
|
1097
1086
|
operation_id = OperationIdPointer(c_uint(0))
|
1098
|
-
cancel = CancelPointer(c_bool(False))
|
1099
1087
|
|
1100
1088
|
_source = to_c_string(source)
|
1101
1089
|
_filter = to_c_string(filter_)
|
@@ -1106,7 +1094,6 @@ class Netconf:
|
|
1106
1094
|
|
1107
1095
|
operation_id = self._get_config(
|
1108
1096
|
operation_id=operation_id,
|
1109
|
-
cancel=cancel,
|
1110
1097
|
source=_source,
|
1111
1098
|
filter_=_filter,
|
1112
1099
|
filter_type=_filter_type,
|
@@ -1153,7 +1140,6 @@ class Netconf:
|
|
1153
1140
|
_ = operation_timeout_ns
|
1154
1141
|
|
1155
1142
|
operation_id = OperationIdPointer(c_uint(0))
|
1156
|
-
cancel = CancelPointer(c_bool(False))
|
1157
1143
|
|
1158
1144
|
_source = to_c_string(source)
|
1159
1145
|
_filter = to_c_string(filter_)
|
@@ -1164,7 +1150,6 @@ class Netconf:
|
|
1164
1150
|
|
1165
1151
|
operation_id = self._get_config(
|
1166
1152
|
operation_id=operation_id,
|
1167
|
-
cancel=cancel,
|
1168
1153
|
source=_source,
|
1169
1154
|
filter_=_filter,
|
1170
1155
|
filter_type=_filter_type,
|
@@ -1179,14 +1164,12 @@ class Netconf:
|
|
1179
1164
|
self,
|
1180
1165
|
*,
|
1181
1166
|
operation_id: OperationIdPointer,
|
1182
|
-
cancel: CancelPointer,
|
1183
1167
|
config: c_char_p,
|
1184
1168
|
target: c_char_p,
|
1185
1169
|
) -> c_uint:
|
1186
1170
|
status = self.ffi_mapping.netconf_mapping.edit_config(
|
1187
1171
|
ptr=self._ptr_or_exception(),
|
1188
1172
|
operation_id=operation_id,
|
1189
|
-
cancel=cancel,
|
1190
1173
|
config=config,
|
1191
1174
|
target=target,
|
1192
1175
|
)
|
@@ -1223,14 +1206,12 @@ class Netconf:
|
|
1223
1206
|
_ = operation_timeout_ns
|
1224
1207
|
|
1225
1208
|
operation_id = OperationIdPointer(c_uint(0))
|
1226
|
-
cancel = CancelPointer(c_bool(False))
|
1227
1209
|
|
1228
1210
|
_config = to_c_string(config)
|
1229
1211
|
_target = to_c_string(target)
|
1230
1212
|
|
1231
1213
|
operation_id = self._edit_config(
|
1232
1214
|
operation_id=operation_id,
|
1233
|
-
cancel=cancel,
|
1234
1215
|
config=_config,
|
1235
1216
|
target=_target,
|
1236
1217
|
)
|
@@ -1265,14 +1246,12 @@ class Netconf:
|
|
1265
1246
|
_ = operation_timeout_ns
|
1266
1247
|
|
1267
1248
|
operation_id = OperationIdPointer(c_uint(0))
|
1268
|
-
cancel = CancelPointer(c_bool(False))
|
1269
1249
|
|
1270
1250
|
_config = to_c_string(config)
|
1271
1251
|
_target = to_c_string(target)
|
1272
1252
|
|
1273
1253
|
operation_id = self._edit_config(
|
1274
1254
|
operation_id=operation_id,
|
1275
|
-
cancel=cancel,
|
1276
1255
|
config=_config,
|
1277
1256
|
target=_target,
|
1278
1257
|
)
|
@@ -1283,14 +1262,12 @@ class Netconf:
|
|
1283
1262
|
self,
|
1284
1263
|
*,
|
1285
1264
|
operation_id: OperationIdPointer,
|
1286
|
-
cancel: CancelPointer,
|
1287
1265
|
target: c_char_p,
|
1288
1266
|
source: c_char_p,
|
1289
1267
|
) -> c_uint:
|
1290
1268
|
status = self.ffi_mapping.netconf_mapping.copy_config(
|
1291
1269
|
ptr=self._ptr_or_exception(),
|
1292
1270
|
operation_id=operation_id,
|
1293
|
-
cancel=cancel,
|
1294
1271
|
target=target,
|
1295
1272
|
source=source,
|
1296
1273
|
)
|
@@ -1327,14 +1304,12 @@ class Netconf:
|
|
1327
1304
|
_ = operation_timeout_ns
|
1328
1305
|
|
1329
1306
|
operation_id = OperationIdPointer(c_uint(0))
|
1330
|
-
cancel = CancelPointer(c_bool(False))
|
1331
1307
|
|
1332
1308
|
_target = to_c_string(target)
|
1333
1309
|
_source = to_c_string(source)
|
1334
1310
|
|
1335
1311
|
operation_id = self._copy_config(
|
1336
1312
|
operation_id=operation_id,
|
1337
|
-
cancel=cancel,
|
1338
1313
|
target=_target,
|
1339
1314
|
source=_source,
|
1340
1315
|
)
|
@@ -1369,14 +1344,12 @@ class Netconf:
|
|
1369
1344
|
_ = operation_timeout_ns
|
1370
1345
|
|
1371
1346
|
operation_id = OperationIdPointer(c_uint(0))
|
1372
|
-
cancel = CancelPointer(c_bool(False))
|
1373
1347
|
|
1374
1348
|
_target = to_c_string(target)
|
1375
1349
|
_source = to_c_string(source)
|
1376
1350
|
|
1377
1351
|
operation_id = self._copy_config(
|
1378
1352
|
operation_id=operation_id,
|
1379
|
-
cancel=cancel,
|
1380
1353
|
target=_target,
|
1381
1354
|
source=_source,
|
1382
1355
|
)
|
@@ -1387,13 +1360,11 @@ class Netconf:
|
|
1387
1360
|
self,
|
1388
1361
|
*,
|
1389
1362
|
operation_id: OperationIdPointer,
|
1390
|
-
cancel: CancelPointer,
|
1391
1363
|
target: c_char_p,
|
1392
1364
|
) -> c_uint:
|
1393
1365
|
status = self.ffi_mapping.netconf_mapping.delete_config(
|
1394
1366
|
ptr=self._ptr_or_exception(),
|
1395
1367
|
operation_id=operation_id,
|
1396
|
-
cancel=cancel,
|
1397
1368
|
target=target,
|
1398
1369
|
)
|
1399
1370
|
if status != 0:
|
@@ -1427,13 +1398,11 @@ class Netconf:
|
|
1427
1398
|
_ = operation_timeout_ns
|
1428
1399
|
|
1429
1400
|
operation_id = OperationIdPointer(c_uint(0))
|
1430
|
-
cancel = CancelPointer(c_bool(False))
|
1431
1401
|
|
1432
1402
|
_target = to_c_string(target)
|
1433
1403
|
|
1434
1404
|
operation_id = self._delete_config(
|
1435
1405
|
operation_id=operation_id,
|
1436
|
-
cancel=cancel,
|
1437
1406
|
target=_target,
|
1438
1407
|
)
|
1439
1408
|
|
@@ -1465,13 +1434,11 @@ class Netconf:
|
|
1465
1434
|
_ = operation_timeout_ns
|
1466
1435
|
|
1467
1436
|
operation_id = OperationIdPointer(c_uint(0))
|
1468
|
-
cancel = CancelPointer(c_bool(False))
|
1469
1437
|
|
1470
1438
|
_target = to_c_string(target)
|
1471
1439
|
|
1472
1440
|
operation_id = self._delete_config(
|
1473
1441
|
operation_id=operation_id,
|
1474
|
-
cancel=cancel,
|
1475
1442
|
target=_target,
|
1476
1443
|
)
|
1477
1444
|
|
@@ -1481,13 +1448,11 @@ class Netconf:
|
|
1481
1448
|
self,
|
1482
1449
|
*,
|
1483
1450
|
operation_id: OperationIdPointer,
|
1484
|
-
cancel: CancelPointer,
|
1485
1451
|
target: c_char_p,
|
1486
1452
|
) -> c_uint:
|
1487
1453
|
status = self.ffi_mapping.netconf_mapping.lock(
|
1488
1454
|
ptr=self._ptr_or_exception(),
|
1489
1455
|
operation_id=operation_id,
|
1490
|
-
cancel=cancel,
|
1491
1456
|
target=target,
|
1492
1457
|
)
|
1493
1458
|
if status != 0:
|
@@ -1521,13 +1486,11 @@ class Netconf:
|
|
1521
1486
|
_ = operation_timeout_ns
|
1522
1487
|
|
1523
1488
|
operation_id = OperationIdPointer(c_uint(0))
|
1524
|
-
cancel = CancelPointer(c_bool(False))
|
1525
1489
|
|
1526
1490
|
_target = to_c_string(target)
|
1527
1491
|
|
1528
1492
|
operation_id = self._lock(
|
1529
1493
|
operation_id=operation_id,
|
1530
|
-
cancel=cancel,
|
1531
1494
|
target=_target,
|
1532
1495
|
)
|
1533
1496
|
|
@@ -1559,13 +1522,11 @@ class Netconf:
|
|
1559
1522
|
_ = operation_timeout_ns
|
1560
1523
|
|
1561
1524
|
operation_id = OperationIdPointer(c_uint(0))
|
1562
|
-
cancel = CancelPointer(c_bool(False))
|
1563
1525
|
|
1564
1526
|
_target = to_c_string(target)
|
1565
1527
|
|
1566
1528
|
operation_id = self._lock(
|
1567
1529
|
operation_id=operation_id,
|
1568
|
-
cancel=cancel,
|
1569
1530
|
target=_target,
|
1570
1531
|
)
|
1571
1532
|
|
@@ -1575,13 +1536,11 @@ class Netconf:
|
|
1575
1536
|
self,
|
1576
1537
|
*,
|
1577
1538
|
operation_id: OperationIdPointer,
|
1578
|
-
cancel: CancelPointer,
|
1579
1539
|
target: c_char_p,
|
1580
1540
|
) -> c_uint:
|
1581
1541
|
status = self.ffi_mapping.netconf_mapping.unlock(
|
1582
1542
|
ptr=self._ptr_or_exception(),
|
1583
1543
|
operation_id=operation_id,
|
1584
|
-
cancel=cancel,
|
1585
1544
|
target=target,
|
1586
1545
|
)
|
1587
1546
|
if status != 0:
|
@@ -1615,13 +1574,11 @@ class Netconf:
|
|
1615
1574
|
_ = operation_timeout_ns
|
1616
1575
|
|
1617
1576
|
operation_id = OperationIdPointer(c_uint(0))
|
1618
|
-
cancel = CancelPointer(c_bool(False))
|
1619
1577
|
|
1620
1578
|
_target = to_c_string(target)
|
1621
1579
|
|
1622
1580
|
operation_id = self._unlock(
|
1623
1581
|
operation_id=operation_id,
|
1624
|
-
cancel=cancel,
|
1625
1582
|
target=_target,
|
1626
1583
|
)
|
1627
1584
|
|
@@ -1653,13 +1610,11 @@ class Netconf:
|
|
1653
1610
|
_ = operation_timeout_ns
|
1654
1611
|
|
1655
1612
|
operation_id = OperationIdPointer(c_uint(0))
|
1656
|
-
cancel = CancelPointer(c_bool(False))
|
1657
1613
|
|
1658
1614
|
_target = to_c_string(target)
|
1659
1615
|
|
1660
1616
|
operation_id = self._unlock(
|
1661
1617
|
operation_id=operation_id,
|
1662
|
-
cancel=cancel,
|
1663
1618
|
target=_target,
|
1664
1619
|
)
|
1665
1620
|
|
@@ -1669,7 +1624,6 @@ class Netconf:
|
|
1669
1624
|
self,
|
1670
1625
|
*,
|
1671
1626
|
operation_id: OperationIdPointer,
|
1672
|
-
cancel: CancelPointer,
|
1673
1627
|
filter_: c_char_p,
|
1674
1628
|
filter_type: c_char_p,
|
1675
1629
|
filter_namespace_prefix: c_char_p,
|
@@ -1679,7 +1633,6 @@ class Netconf:
|
|
1679
1633
|
status = self.ffi_mapping.netconf_mapping.get(
|
1680
1634
|
ptr=self._ptr_or_exception(),
|
1681
1635
|
operation_id=operation_id,
|
1682
|
-
cancel=cancel,
|
1683
1636
|
filter_=filter_,
|
1684
1637
|
filter_type=filter_type,
|
1685
1638
|
filter_namespace_prefix=filter_namespace_prefix,
|
@@ -1725,7 +1678,6 @@ class Netconf:
|
|
1725
1678
|
_ = operation_timeout_ns
|
1726
1679
|
|
1727
1680
|
operation_id = OperationIdPointer(c_uint(0))
|
1728
|
-
cancel = CancelPointer(c_bool(False))
|
1729
1681
|
|
1730
1682
|
_filter = to_c_string(filter_)
|
1731
1683
|
_filter_type = to_c_string(filter_type)
|
@@ -1735,7 +1687,6 @@ class Netconf:
|
|
1735
1687
|
|
1736
1688
|
operation_id = self._get(
|
1737
1689
|
operation_id=operation_id,
|
1738
|
-
cancel=cancel,
|
1739
1690
|
filter_=_filter,
|
1740
1691
|
filter_type=_filter_type,
|
1741
1692
|
filter_namespace_prefix=_filter_namespace_prefix,
|
@@ -1779,7 +1730,6 @@ class Netconf:
|
|
1779
1730
|
_ = operation_timeout_ns
|
1780
1731
|
|
1781
1732
|
operation_id = OperationIdPointer(c_uint(0))
|
1782
|
-
cancel = CancelPointer(c_bool(False))
|
1783
1733
|
|
1784
1734
|
_filter = to_c_string(filter_)
|
1785
1735
|
_filter_type = to_c_string(filter_type)
|
@@ -1789,7 +1739,6 @@ class Netconf:
|
|
1789
1739
|
|
1790
1740
|
operation_id = self._get(
|
1791
1741
|
operation_id=operation_id,
|
1792
|
-
cancel=cancel,
|
1793
1742
|
filter_=_filter,
|
1794
1743
|
filter_type=_filter_type,
|
1795
1744
|
filter_namespace_prefix=_filter_namespace_prefix,
|
@@ -1803,12 +1752,10 @@ class Netconf:
|
|
1803
1752
|
self,
|
1804
1753
|
*,
|
1805
1754
|
operation_id: OperationIdPointer,
|
1806
|
-
cancel: CancelPointer,
|
1807
1755
|
) -> c_uint:
|
1808
1756
|
status = self.ffi_mapping.netconf_mapping.close_session(
|
1809
1757
|
ptr=self._ptr_or_exception(),
|
1810
1758
|
operation_id=operation_id,
|
1811
|
-
cancel=cancel,
|
1812
1759
|
)
|
1813
1760
|
if status != 0:
|
1814
1761
|
raise SubmitOperationException("submitting close-session operation failed")
|
@@ -1839,11 +1786,9 @@ class Netconf:
|
|
1839
1786
|
_ = operation_timeout_ns
|
1840
1787
|
|
1841
1788
|
operation_id = OperationIdPointer(c_uint(0))
|
1842
|
-
cancel = CancelPointer(c_bool(False))
|
1843
1789
|
|
1844
1790
|
operation_id = self._close_session(
|
1845
1791
|
operation_id=operation_id,
|
1846
|
-
cancel=cancel,
|
1847
1792
|
)
|
1848
1793
|
|
1849
1794
|
return self._get_result(operation_id=operation_id)
|
@@ -1872,11 +1817,9 @@ class Netconf:
|
|
1872
1817
|
_ = operation_timeout_ns
|
1873
1818
|
|
1874
1819
|
operation_id = OperationIdPointer(c_uint(0))
|
1875
|
-
cancel = CancelPointer(c_bool(False))
|
1876
1820
|
|
1877
1821
|
operation_id = self._close_session(
|
1878
1822
|
operation_id=operation_id,
|
1879
|
-
cancel=cancel,
|
1880
1823
|
)
|
1881
1824
|
|
1882
1825
|
return await self._get_result_async(operation_id=operation_id)
|
@@ -1885,13 +1828,11 @@ class Netconf:
|
|
1885
1828
|
self,
|
1886
1829
|
*,
|
1887
1830
|
operation_id: OperationIdPointer,
|
1888
|
-
cancel: CancelPointer,
|
1889
1831
|
session_id: int,
|
1890
1832
|
) -> c_uint:
|
1891
1833
|
status = self.ffi_mapping.netconf_mapping.kill_session(
|
1892
1834
|
ptr=self._ptr_or_exception(),
|
1893
1835
|
operation_id=operation_id,
|
1894
|
-
cancel=cancel,
|
1895
1836
|
session_id=c_int(session_id),
|
1896
1837
|
)
|
1897
1838
|
if status != 0:
|
@@ -1925,11 +1866,9 @@ class Netconf:
|
|
1925
1866
|
_ = operation_timeout_ns
|
1926
1867
|
|
1927
1868
|
operation_id = OperationIdPointer(c_uint(0))
|
1928
|
-
cancel = CancelPointer(c_bool(False))
|
1929
1869
|
|
1930
1870
|
operation_id = self._kill_session(
|
1931
1871
|
operation_id=operation_id,
|
1932
|
-
cancel=cancel,
|
1933
1872
|
session_id=session_id,
|
1934
1873
|
)
|
1935
1874
|
|
@@ -1961,11 +1900,9 @@ class Netconf:
|
|
1961
1900
|
_ = operation_timeout_ns
|
1962
1901
|
|
1963
1902
|
operation_id = OperationIdPointer(c_uint(0))
|
1964
|
-
cancel = CancelPointer(c_bool(False))
|
1965
1903
|
|
1966
1904
|
operation_id = self._kill_session(
|
1967
1905
|
operation_id=operation_id,
|
1968
|
-
cancel=cancel,
|
1969
1906
|
session_id=session_id,
|
1970
1907
|
)
|
1971
1908
|
|
@@ -1975,12 +1912,10 @@ class Netconf:
|
|
1975
1912
|
self,
|
1976
1913
|
*,
|
1977
1914
|
operation_id: OperationIdPointer,
|
1978
|
-
cancel: CancelPointer,
|
1979
1915
|
) -> c_uint:
|
1980
1916
|
status = self.ffi_mapping.netconf_mapping.commit(
|
1981
1917
|
ptr=self._ptr_or_exception(),
|
1982
1918
|
operation_id=operation_id,
|
1983
|
-
cancel=cancel,
|
1984
1919
|
)
|
1985
1920
|
if status != 0:
|
1986
1921
|
raise SubmitOperationException("submitting commit operation failed")
|
@@ -2011,11 +1946,9 @@ class Netconf:
|
|
2011
1946
|
_ = operation_timeout_ns
|
2012
1947
|
|
2013
1948
|
operation_id = OperationIdPointer(c_uint(0))
|
2014
|
-
cancel = CancelPointer(c_bool(False))
|
2015
1949
|
|
2016
1950
|
operation_id = self._commit(
|
2017
1951
|
operation_id=operation_id,
|
2018
|
-
cancel=cancel,
|
2019
1952
|
)
|
2020
1953
|
|
2021
1954
|
return self._get_result(operation_id=operation_id)
|
@@ -2044,11 +1977,9 @@ class Netconf:
|
|
2044
1977
|
_ = operation_timeout_ns
|
2045
1978
|
|
2046
1979
|
operation_id = OperationIdPointer(c_uint(0))
|
2047
|
-
cancel = CancelPointer(c_bool(False))
|
2048
1980
|
|
2049
1981
|
operation_id = self._commit(
|
2050
1982
|
operation_id=operation_id,
|
2051
|
-
cancel=cancel,
|
2052
1983
|
)
|
2053
1984
|
|
2054
1985
|
return await self._get_result_async(operation_id=operation_id)
|
@@ -2057,12 +1988,10 @@ class Netconf:
|
|
2057
1988
|
self,
|
2058
1989
|
*,
|
2059
1990
|
operation_id: OperationIdPointer,
|
2060
|
-
cancel: CancelPointer,
|
2061
1991
|
) -> c_uint:
|
2062
1992
|
status = self.ffi_mapping.netconf_mapping.discard(
|
2063
1993
|
ptr=self._ptr_or_exception(),
|
2064
1994
|
operation_id=operation_id,
|
2065
|
-
cancel=cancel,
|
2066
1995
|
)
|
2067
1996
|
if status != 0:
|
2068
1997
|
raise SubmitOperationException("submitting discard operation failed")
|
@@ -2093,11 +2022,9 @@ class Netconf:
|
|
2093
2022
|
_ = operation_timeout_ns
|
2094
2023
|
|
2095
2024
|
operation_id = OperationIdPointer(c_uint(0))
|
2096
|
-
cancel = CancelPointer(c_bool(False))
|
2097
2025
|
|
2098
2026
|
operation_id = self._discard(
|
2099
2027
|
operation_id=operation_id,
|
2100
|
-
cancel=cancel,
|
2101
2028
|
)
|
2102
2029
|
|
2103
2030
|
return self._get_result(operation_id=operation_id)
|
@@ -2126,11 +2053,9 @@ class Netconf:
|
|
2126
2053
|
_ = operation_timeout_ns
|
2127
2054
|
|
2128
2055
|
operation_id = OperationIdPointer(c_uint(0))
|
2129
|
-
cancel = CancelPointer(c_bool(False))
|
2130
2056
|
|
2131
2057
|
operation_id = self._discard(
|
2132
2058
|
operation_id=operation_id,
|
2133
|
-
cancel=cancel,
|
2134
2059
|
)
|
2135
2060
|
|
2136
2061
|
return await self._get_result_async(operation_id=operation_id)
|
@@ -2139,12 +2064,10 @@ class Netconf:
|
|
2139
2064
|
self,
|
2140
2065
|
*,
|
2141
2066
|
operation_id: OperationIdPointer,
|
2142
|
-
cancel: CancelPointer,
|
2143
2067
|
) -> c_uint:
|
2144
2068
|
status = self.ffi_mapping.netconf_mapping.cancel_commit(
|
2145
2069
|
ptr=self._ptr_or_exception(),
|
2146
2070
|
operation_id=operation_id,
|
2147
|
-
cancel=cancel,
|
2148
2071
|
)
|
2149
2072
|
if status != 0:
|
2150
2073
|
raise SubmitOperationException("submitting cancel-commit operation failed")
|
@@ -2175,11 +2098,9 @@ class Netconf:
|
|
2175
2098
|
_ = operation_timeout_ns
|
2176
2099
|
|
2177
2100
|
operation_id = OperationIdPointer(c_uint(0))
|
2178
|
-
cancel = CancelPointer(c_bool(False))
|
2179
2101
|
|
2180
2102
|
operation_id = self._cancel_commit(
|
2181
2103
|
operation_id=operation_id,
|
2182
|
-
cancel=cancel,
|
2183
2104
|
)
|
2184
2105
|
|
2185
2106
|
return self._get_result(operation_id=operation_id)
|
@@ -2208,11 +2129,9 @@ class Netconf:
|
|
2208
2129
|
_ = operation_timeout_ns
|
2209
2130
|
|
2210
2131
|
operation_id = OperationIdPointer(c_uint(0))
|
2211
|
-
cancel = CancelPointer(c_bool(False))
|
2212
2132
|
|
2213
2133
|
operation_id = self._cancel_commit(
|
2214
2134
|
operation_id=operation_id,
|
2215
|
-
cancel=cancel,
|
2216
2135
|
)
|
2217
2136
|
|
2218
2137
|
return await self._get_result_async(operation_id=operation_id)
|
@@ -2221,13 +2140,11 @@ class Netconf:
|
|
2221
2140
|
self,
|
2222
2141
|
*,
|
2223
2142
|
operation_id: OperationIdPointer,
|
2224
|
-
cancel: CancelPointer,
|
2225
2143
|
source: c_char_p,
|
2226
2144
|
) -> c_uint:
|
2227
2145
|
status = self.ffi_mapping.netconf_mapping.validate(
|
2228
2146
|
ptr=self._ptr_or_exception(),
|
2229
2147
|
operation_id=operation_id,
|
2230
|
-
cancel=cancel,
|
2231
2148
|
source=source,
|
2232
2149
|
)
|
2233
2150
|
if status != 0:
|
@@ -2261,13 +2178,11 @@ class Netconf:
|
|
2261
2178
|
_ = operation_timeout_ns
|
2262
2179
|
|
2263
2180
|
operation_id = OperationIdPointer(c_uint(0))
|
2264
|
-
cancel = CancelPointer(c_bool(False))
|
2265
2181
|
|
2266
2182
|
_source = to_c_string(source)
|
2267
2183
|
|
2268
2184
|
operation_id = self._validate(
|
2269
2185
|
operation_id=operation_id,
|
2270
|
-
cancel=cancel,
|
2271
2186
|
source=_source,
|
2272
2187
|
)
|
2273
2188
|
|
@@ -2299,13 +2214,11 @@ class Netconf:
|
|
2299
2214
|
_ = operation_timeout_ns
|
2300
2215
|
|
2301
2216
|
operation_id = OperationIdPointer(c_uint(0))
|
2302
|
-
cancel = CancelPointer(c_bool(False))
|
2303
2217
|
|
2304
2218
|
_source = to_c_string(source)
|
2305
2219
|
|
2306
2220
|
operation_id = self._validate(
|
2307
2221
|
operation_id=operation_id,
|
2308
|
-
cancel=cancel,
|
2309
2222
|
source=_source,
|
2310
2223
|
)
|
2311
2224
|
|
@@ -2315,7 +2228,6 @@ class Netconf:
|
|
2315
2228
|
self,
|
2316
2229
|
*,
|
2317
2230
|
operation_id: OperationIdPointer,
|
2318
|
-
cancel: CancelPointer,
|
2319
2231
|
identifier: c_char_p,
|
2320
2232
|
version: c_char_p,
|
2321
2233
|
format_: c_char_p,
|
@@ -2323,7 +2235,6 @@ class Netconf:
|
|
2323
2235
|
status = self.ffi_mapping.netconf_mapping.get_schema(
|
2324
2236
|
ptr=self._ptr_or_exception(),
|
2325
2237
|
operation_id=operation_id,
|
2326
|
-
cancel=cancel,
|
2327
2238
|
identifier=identifier,
|
2328
2239
|
version=version,
|
2329
2240
|
format_=format_,
|
@@ -2363,7 +2274,6 @@ class Netconf:
|
|
2363
2274
|
_ = operation_timeout_ns
|
2364
2275
|
|
2365
2276
|
operation_id = OperationIdPointer(c_uint(0))
|
2366
|
-
cancel = CancelPointer(c_bool(False))
|
2367
2277
|
|
2368
2278
|
_identifier = to_c_string(identifier)
|
2369
2279
|
_version = to_c_string(version)
|
@@ -2371,7 +2281,6 @@ class Netconf:
|
|
2371
2281
|
|
2372
2282
|
operation_id = self._get_schema(
|
2373
2283
|
operation_id=operation_id,
|
2374
|
-
cancel=cancel,
|
2375
2284
|
identifier=_identifier,
|
2376
2285
|
version=_version,
|
2377
2286
|
format_=_format,
|
@@ -2409,7 +2318,6 @@ class Netconf:
|
|
2409
2318
|
_ = operation_timeout_ns
|
2410
2319
|
|
2411
2320
|
operation_id = OperationIdPointer(c_uint(0))
|
2412
|
-
cancel = CancelPointer(c_bool(False))
|
2413
2321
|
|
2414
2322
|
_identifier = to_c_string(identifier)
|
2415
2323
|
_version = to_c_string(version)
|
@@ -2417,7 +2325,6 @@ class Netconf:
|
|
2417
2325
|
|
2418
2326
|
operation_id = self._get_schema(
|
2419
2327
|
operation_id=operation_id,
|
2420
|
-
cancel=cancel,
|
2421
2328
|
identifier=_identifier,
|
2422
2329
|
version=_version,
|
2423
2330
|
format_=_format,
|
@@ -2429,7 +2336,6 @@ class Netconf:
|
|
2429
2336
|
self,
|
2430
2337
|
*,
|
2431
2338
|
operation_id: OperationIdPointer,
|
2432
|
-
cancel: CancelPointer,
|
2433
2339
|
source: c_char_p,
|
2434
2340
|
filter_: c_char_p,
|
2435
2341
|
filter_type: c_char_p,
|
@@ -2444,7 +2350,6 @@ class Netconf:
|
|
2444
2350
|
status = self.ffi_mapping.netconf_mapping.get_data(
|
2445
2351
|
ptr=self._ptr_or_exception(),
|
2446
2352
|
operation_id=operation_id,
|
2447
|
-
cancel=cancel,
|
2448
2353
|
source=source,
|
2449
2354
|
filter_=filter_,
|
2450
2355
|
filter_type=filter_type,
|
@@ -2505,7 +2410,6 @@ class Netconf:
|
|
2505
2410
|
_ = operation_timeout_ns
|
2506
2411
|
|
2507
2412
|
operation_id = OperationIdPointer(c_uint(0))
|
2508
|
-
cancel = CancelPointer(c_bool(False))
|
2509
2413
|
|
2510
2414
|
_source = to_c_string(source)
|
2511
2415
|
_filter = to_c_string(filter_)
|
@@ -2518,7 +2422,6 @@ class Netconf:
|
|
2518
2422
|
|
2519
2423
|
operation_id = self._get_data(
|
2520
2424
|
operation_id=operation_id,
|
2521
|
-
cancel=cancel,
|
2522
2425
|
source=_source,
|
2523
2426
|
filter_=_filter,
|
2524
2427
|
filter_type=_filter_type,
|
@@ -2577,7 +2480,6 @@ class Netconf:
|
|
2577
2480
|
_ = operation_timeout_ns
|
2578
2481
|
|
2579
2482
|
operation_id = OperationIdPointer(c_uint(0))
|
2580
|
-
cancel = CancelPointer(c_bool(False))
|
2581
2483
|
|
2582
2484
|
_source = to_c_string(source)
|
2583
2485
|
_filter = to_c_string(filter_)
|
@@ -2590,7 +2492,6 @@ class Netconf:
|
|
2590
2492
|
|
2591
2493
|
operation_id = self._get_data(
|
2592
2494
|
operation_id=operation_id,
|
2593
|
-
cancel=cancel,
|
2594
2495
|
source=_source,
|
2595
2496
|
filter_=_filter,
|
2596
2497
|
filter_type=_filter_type,
|
@@ -2609,14 +2510,12 @@ class Netconf:
|
|
2609
2510
|
self,
|
2610
2511
|
*,
|
2611
2512
|
operation_id: OperationIdPointer,
|
2612
|
-
cancel: CancelPointer,
|
2613
2513
|
content: c_char_p,
|
2614
2514
|
target: c_char_p,
|
2615
2515
|
) -> c_uint:
|
2616
2516
|
status = self.ffi_mapping.netconf_mapping.edit_data(
|
2617
2517
|
ptr=self._ptr_or_exception(),
|
2618
2518
|
operation_id=operation_id,
|
2619
|
-
cancel=cancel,
|
2620
2519
|
content=content,
|
2621
2520
|
target=target,
|
2622
2521
|
)
|
@@ -2653,14 +2552,12 @@ class Netconf:
|
|
2653
2552
|
_ = operation_timeout_ns
|
2654
2553
|
|
2655
2554
|
operation_id = OperationIdPointer(c_uint(0))
|
2656
|
-
cancel = CancelPointer(c_bool(False))
|
2657
2555
|
|
2658
2556
|
_content = to_c_string(content)
|
2659
2557
|
_target = to_c_string(target)
|
2660
2558
|
|
2661
2559
|
operation_id = self._edit_data(
|
2662
2560
|
operation_id=operation_id,
|
2663
|
-
cancel=cancel,
|
2664
2561
|
content=_content,
|
2665
2562
|
target=_target,
|
2666
2563
|
)
|
@@ -2695,14 +2592,12 @@ class Netconf:
|
|
2695
2592
|
_ = operation_timeout_ns
|
2696
2593
|
|
2697
2594
|
operation_id = OperationIdPointer(c_uint(0))
|
2698
|
-
cancel = CancelPointer(c_bool(False))
|
2699
2595
|
|
2700
2596
|
_content = to_c_string(content)
|
2701
2597
|
_target = to_c_string(target)
|
2702
2598
|
|
2703
2599
|
operation_id = self._edit_data(
|
2704
2600
|
operation_id=operation_id,
|
2705
|
-
cancel=cancel,
|
2706
2601
|
content=_content,
|
2707
2602
|
target=_target,
|
2708
2603
|
)
|
@@ -2713,13 +2608,11 @@ class Netconf:
|
|
2713
2608
|
self,
|
2714
2609
|
*,
|
2715
2610
|
operation_id: OperationIdPointer,
|
2716
|
-
cancel: CancelPointer,
|
2717
2611
|
action: c_char_p,
|
2718
2612
|
) -> c_uint:
|
2719
2613
|
status = self.ffi_mapping.netconf_mapping.action(
|
2720
2614
|
ptr=self._ptr_or_exception(),
|
2721
2615
|
operation_id=operation_id,
|
2722
|
-
cancel=cancel,
|
2723
2616
|
action=action,
|
2724
2617
|
)
|
2725
2618
|
if status != 0:
|
@@ -2753,13 +2646,11 @@ class Netconf:
|
|
2753
2646
|
_ = operation_timeout_ns
|
2754
2647
|
|
2755
2648
|
operation_id = OperationIdPointer(c_uint(0))
|
2756
|
-
cancel = CancelPointer(c_bool(False))
|
2757
2649
|
|
2758
2650
|
_action = to_c_string(action)
|
2759
2651
|
|
2760
2652
|
operation_id = self._action(
|
2761
2653
|
operation_id=operation_id,
|
2762
|
-
cancel=cancel,
|
2763
2654
|
action=_action,
|
2764
2655
|
)
|
2765
2656
|
|
@@ -2791,13 +2682,11 @@ class Netconf:
|
|
2791
2682
|
_ = operation_timeout_ns
|
2792
2683
|
|
2793
2684
|
operation_id = OperationIdPointer(c_uint(0))
|
2794
|
-
cancel = CancelPointer(c_bool(False))
|
2795
2685
|
|
2796
2686
|
_action = to_c_string(action)
|
2797
2687
|
|
2798
2688
|
operation_id = self._action(
|
2799
2689
|
operation_id=operation_id,
|
2800
|
-
cancel=cancel,
|
2801
2690
|
action=_action,
|
2802
2691
|
)
|
2803
2692
|
|