js7-client-python 2.0.1.0__py3-none-any.whl → 2.0.2__py3-none-any.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.
- js7/client/auth/auth_provider.py +0 -1
- js7/client/feature/agent/agent.py +0 -1
- js7/client/feature/agent/manage.py +423 -41
- js7/client/feature/agent/operate.py +27 -410
- js7/client/feature/controller/manage.py +34 -0
- js7/client/feature/controller/operate.py +1 -34
- js7/client/feature/daily_plan/manage.py +234 -1
- js7/client/feature/daily_plan/operate.py +1 -233
- js7/client/feature/inventory/deploy.py +171 -0
- js7/client/feature/inventory/inventory.py +6 -1
- js7/client/feature/inventory/manage.py +2 -162
- js7/client/feature/joc/manage.py +35 -0
- js7/client/feature/joc/operate.py +2 -34
- js7/client/feature/workflow/manage.py +49 -1
- js7/client/feature/workflow/operate.py +0 -46
- {js7_client_python-2.0.1.0.dist-info → js7_client_python-2.0.2.dist-info}/METADATA +40 -20
- {js7_client_python-2.0.1.0.dist-info → js7_client_python-2.0.2.dist-info}/RECORD +20 -19
- {js7_client_python-2.0.1.0.dist-info → js7_client_python-2.0.2.dist-info}/LICENSE +0 -0
- {js7_client_python-2.0.1.0.dist-info → js7_client_python-2.0.2.dist-info}/WHEEL +0 -0
- {js7_client_python-2.0.1.0.dist-info → js7_client_python-2.0.2.dist-info}/top_level.txt +0 -0
js7/client/auth/auth_provider.py
CHANGED
|
@@ -5,7 +5,10 @@ from ....client.context import Context
|
|
|
5
5
|
from ....model.public.client.common.audit_log import AuditLog
|
|
6
6
|
from ....model.public.client.common.store_agents import StoreAgent, StoreClusterAgent, StoreSubagent, SubagentCluster
|
|
7
7
|
|
|
8
|
-
from ...action.agent.
|
|
8
|
+
from ...action.agent.disable_standalone_agents_action import disable_standalone_agents_action
|
|
9
|
+
from ...action.agent.disable_subagents_action import disable_subagents_action
|
|
10
|
+
from ...action.agent.enable_subagents_action import enable_subagents_action
|
|
11
|
+
from ...action.agent.enable_standalone_agents_action import enable_standalone_agents_action
|
|
9
12
|
from ...action.agent.export_agents_action import export_agents_action
|
|
10
13
|
from ...action.agent.get_agents_status_action import get_agents_status_action
|
|
11
14
|
from ...action.agent.store_cluster_agents_action import store_cluster_agents_action
|
|
@@ -13,51 +16,17 @@ from ...action.agent.store_standalone_agents_action import store_standalone_agen
|
|
|
13
16
|
from ...action.agent.store_subagent_clusters_action import store_subagent_clusters_action
|
|
14
17
|
from ...action.agent.store_subagents_action import store_subagents_action
|
|
15
18
|
from ...action.agent.import_agents_action import import_agents_action
|
|
19
|
+
from ...action.agent.delete_subagent_action import delete_subagent_action
|
|
20
|
+
from ...action.agent.delete_subagent_clusters_action import delete_subagent_clusters_action
|
|
21
|
+
from ...action.agent.remove_agent_action import remove_agent_action
|
|
22
|
+
from ...action.agent.revoke_cluster_agents_action import revoke_cluster_agents_action
|
|
23
|
+
from ...action.agent.revoke_standalone_agents_action import revoke_standalone_agents_action
|
|
24
|
+
from ...action.agent.revoke_subagent_clusters_action import revoke_subagent_clusters_action
|
|
16
25
|
|
|
17
26
|
|
|
18
27
|
class Manage:
|
|
19
28
|
def __init__(self, context: Context):
|
|
20
29
|
self._ctx = context
|
|
21
|
-
|
|
22
|
-
def confirm_node_loss_agent(
|
|
23
|
-
self,
|
|
24
|
-
controller_id: str,
|
|
25
|
-
agent_id: str,
|
|
26
|
-
audit_log: Optional[AuditLog] = None
|
|
27
|
-
) -> bool:
|
|
28
|
-
"""
|
|
29
|
-
Confirm the loss of an agent for a controller operating in cluster mode.
|
|
30
|
-
|
|
31
|
-
Args:
|
|
32
|
-
controller_id (str):
|
|
33
|
-
The ID of the controller on which the operation will be executed.
|
|
34
|
-
|
|
35
|
-
agent_id (str):
|
|
36
|
-
The ID of the agent whose loss should be confirmed.
|
|
37
|
-
|
|
38
|
-
audit_log (Optional[AuditLog]):
|
|
39
|
-
Optional audit log information to create an audit entry
|
|
40
|
-
for this operation.
|
|
41
|
-
|
|
42
|
-
Returns:
|
|
43
|
-
bool:
|
|
44
|
-
Returns `True` if the operation was successful.
|
|
45
|
-
|
|
46
|
-
Raises:
|
|
47
|
-
ValueError:
|
|
48
|
-
If required arguments are missing or invalid.
|
|
49
|
-
|
|
50
|
-
RuntimeError:
|
|
51
|
-
If the server version is incompatible or if an unexpected
|
|
52
|
-
response is returned.
|
|
53
|
-
"""
|
|
54
|
-
|
|
55
|
-
return confirm_node_loss_agent_action(
|
|
56
|
-
context=self._ctx,
|
|
57
|
-
controller_id=controller_id,
|
|
58
|
-
agent_id=agent_id,
|
|
59
|
-
audit_log=audit_log
|
|
60
|
-
)
|
|
61
30
|
|
|
62
31
|
def export_agents(
|
|
63
32
|
self,
|
|
@@ -359,5 +328,418 @@ class Manage:
|
|
|
359
328
|
overwrite=overwrite,
|
|
360
329
|
audit_log=audit_log
|
|
361
330
|
)
|
|
331
|
+
|
|
332
|
+
def delete_subagent(
|
|
333
|
+
self,
|
|
334
|
+
controller_id: str,
|
|
335
|
+
subagent_id: str,
|
|
336
|
+
audit_log: Optional[AuditLog] = None
|
|
337
|
+
) -> bool:
|
|
338
|
+
"""
|
|
339
|
+
Delete a subagent from the specified controller.
|
|
340
|
+
|
|
341
|
+
Args:
|
|
342
|
+
controller_id (str):
|
|
343
|
+
The ID of the controller from which the subagent
|
|
344
|
+
should be deleted.
|
|
345
|
+
|
|
346
|
+
subagent_id (str):
|
|
347
|
+
The ID of the subagent to be deleted.
|
|
348
|
+
|
|
349
|
+
audit_log (Optional[AuditLog]):
|
|
350
|
+
Optional audit log information to create an audit entry
|
|
351
|
+
for this operation.
|
|
352
|
+
|
|
353
|
+
Returns:
|
|
354
|
+
bool:
|
|
355
|
+
Returns `True` if the operation was successful, otherwise `False`.
|
|
356
|
+
|
|
357
|
+
Raises:
|
|
358
|
+
ValueError:
|
|
359
|
+
If required arguments are missing or invalid.
|
|
360
|
+
|
|
361
|
+
RuntimeError:
|
|
362
|
+
If the server version is incompatible or if an unexpected
|
|
363
|
+
response is returned.
|
|
364
|
+
"""
|
|
365
|
+
|
|
366
|
+
return delete_subagent_action(
|
|
367
|
+
context=self._ctx,
|
|
368
|
+
controller_id=controller_id,
|
|
369
|
+
subagent_id=subagent_id,
|
|
370
|
+
audit_log=audit_log
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
def delete_subagent_clusters(
|
|
374
|
+
self,
|
|
375
|
+
controller_id: str,
|
|
376
|
+
subagent_cluster_ids: List[str],
|
|
377
|
+
audit_log: Optional[AuditLog] = None
|
|
378
|
+
) -> bool:
|
|
379
|
+
"""
|
|
380
|
+
Delete one or more subagent clusters from the specified controller.
|
|
381
|
+
|
|
382
|
+
Args:
|
|
383
|
+
controller_id (str):
|
|
384
|
+
The ID of the controller from which the subagent clusters
|
|
385
|
+
should be deleted.
|
|
386
|
+
|
|
387
|
+
subagent_cluster_ids (List[str]):
|
|
388
|
+
A list of subagent cluster IDs to be deleted.
|
|
389
|
+
|
|
390
|
+
audit_log (Optional[AuditLog]):
|
|
391
|
+
Optional audit log information to create an audit entry
|
|
392
|
+
for this operation.
|
|
393
|
+
|
|
394
|
+
Returns:
|
|
395
|
+
bool:
|
|
396
|
+
Returns `True` if the operation was successful, otherwise `False`.
|
|
397
|
+
|
|
398
|
+
Raises:
|
|
399
|
+
ValueError:
|
|
400
|
+
If required arguments are missing or invalid.
|
|
401
|
+
|
|
402
|
+
RuntimeError:
|
|
403
|
+
If the server version is incompatible or if an unexpected
|
|
404
|
+
response is returned.
|
|
405
|
+
"""
|
|
362
406
|
|
|
407
|
+
return delete_subagent_clusters_action(
|
|
408
|
+
context=self._ctx,
|
|
409
|
+
controller_id=controller_id,
|
|
410
|
+
subagent_cluster_ids=subagent_cluster_ids,
|
|
411
|
+
audit_log=audit_log
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
def disable_standalone_agents(
|
|
415
|
+
self,
|
|
416
|
+
controller_id: str,
|
|
417
|
+
agent_ids: List[str],
|
|
418
|
+
audit_log: Optional[AuditLog] = None
|
|
419
|
+
) -> bool:
|
|
420
|
+
"""
|
|
421
|
+
Disable standalone agents at the specified controller.
|
|
422
|
+
|
|
423
|
+
Args:
|
|
424
|
+
controller_id (str):
|
|
425
|
+
The ID of the controller on which the operation
|
|
426
|
+
will be executed.
|
|
427
|
+
|
|
428
|
+
agent_ids (List[str]):
|
|
429
|
+
A list of standalone agent IDs to be disabled.
|
|
430
|
+
|
|
431
|
+
audit_log (Optional[AuditLog]):
|
|
432
|
+
Optional audit log information to create an audit entry
|
|
433
|
+
for this operation.
|
|
434
|
+
|
|
435
|
+
Returns:
|
|
436
|
+
bool:
|
|
437
|
+
Returns `True` if the operation was successful, otherwise `False`.
|
|
438
|
+
|
|
439
|
+
Raises:
|
|
440
|
+
ValueError:
|
|
441
|
+
If required arguments are missing or invalid.
|
|
442
|
+
|
|
443
|
+
RuntimeError:
|
|
444
|
+
If the server version is incompatible or if an unexpected
|
|
445
|
+
response is returned.
|
|
446
|
+
"""
|
|
447
|
+
|
|
448
|
+
return disable_standalone_agents_action(
|
|
449
|
+
context=self._ctx,
|
|
450
|
+
controller_id=controller_id,
|
|
451
|
+
agent_ids=agent_ids,
|
|
452
|
+
audit_log=audit_log
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
def disable_subagents(
|
|
456
|
+
self,
|
|
457
|
+
controller_id: str,
|
|
458
|
+
subagent_ids: List[str],
|
|
459
|
+
audit_log: Optional[AuditLog] = None
|
|
460
|
+
) -> bool:
|
|
461
|
+
"""
|
|
462
|
+
Disable subagents at the specified controller.
|
|
463
|
+
|
|
464
|
+
Args:
|
|
465
|
+
controller_id (str):
|
|
466
|
+
The ID of the controller on which the operation
|
|
467
|
+
will be executed.
|
|
468
|
+
|
|
469
|
+
subagent_ids (List[str]):
|
|
470
|
+
A list of subagent IDs to be disabled.
|
|
471
|
+
|
|
472
|
+
audit_log (Optional[AuditLog]):
|
|
473
|
+
Optional audit log information to create an audit entry
|
|
474
|
+
for this operation.
|
|
475
|
+
|
|
476
|
+
Returns:
|
|
477
|
+
bool:
|
|
478
|
+
Returns `True` if the operation was successful, otherwise `False`.
|
|
479
|
+
|
|
480
|
+
Raises:
|
|
481
|
+
ValueError:
|
|
482
|
+
If required arguments are missing or invalid.
|
|
483
|
+
|
|
484
|
+
RuntimeError:
|
|
485
|
+
If the server version is incompatible or if an unexpected
|
|
486
|
+
response is returned.
|
|
487
|
+
"""
|
|
488
|
+
|
|
489
|
+
return disable_subagents_action(
|
|
490
|
+
context=self._ctx,
|
|
491
|
+
controller_id=controller_id,
|
|
492
|
+
subagent_ids=subagent_ids,
|
|
493
|
+
audit_log=audit_log
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
def enable_standalone_agents(
|
|
497
|
+
self,
|
|
498
|
+
controller_id: str,
|
|
499
|
+
agent_ids: List[str],
|
|
500
|
+
audit_log: Optional[AuditLog] = None
|
|
501
|
+
) -> bool:
|
|
502
|
+
"""
|
|
503
|
+
Enable standalone agents at the specified controller.
|
|
504
|
+
|
|
505
|
+
Args:
|
|
506
|
+
controller_id (str):
|
|
507
|
+
The ID of the controller on which the operation
|
|
508
|
+
will be executed.
|
|
509
|
+
|
|
510
|
+
agent_ids (List[str]):
|
|
511
|
+
A list of standalone agent IDs to be enabled.
|
|
512
|
+
|
|
513
|
+
audit_log (Optional[AuditLog]):
|
|
514
|
+
Optional audit log information to create an audit entry
|
|
515
|
+
for this operation.
|
|
516
|
+
|
|
517
|
+
Returns:
|
|
518
|
+
bool:
|
|
519
|
+
Returns `True` if the operation was successful, otherwise `False`.
|
|
520
|
+
|
|
521
|
+
Raises:
|
|
522
|
+
ValueError:
|
|
523
|
+
If required arguments are missing or invalid.
|
|
524
|
+
|
|
525
|
+
RuntimeError:
|
|
526
|
+
If the server version is incompatible or if an unexpected
|
|
527
|
+
response is returned.
|
|
528
|
+
"""
|
|
529
|
+
|
|
530
|
+
return enable_standalone_agents_action(
|
|
531
|
+
context=self._ctx,
|
|
532
|
+
controller_id=controller_id,
|
|
533
|
+
agent_ids=agent_ids,
|
|
534
|
+
audit_log=audit_log
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
def enable_subagents(
|
|
538
|
+
self,
|
|
539
|
+
controller_id: str,
|
|
540
|
+
subagent_ids: List[str],
|
|
541
|
+
audit_log: Optional[AuditLog] = None
|
|
542
|
+
) -> bool:
|
|
543
|
+
"""
|
|
544
|
+
Enable subagents at the specified controller.
|
|
545
|
+
|
|
546
|
+
Args:
|
|
547
|
+
controller_id (str):
|
|
548
|
+
The ID of the controller on which the operation
|
|
549
|
+
will be executed.
|
|
550
|
+
|
|
551
|
+
subagent_ids (List[str]):
|
|
552
|
+
A list of subagent IDs to be enabled.
|
|
553
|
+
|
|
554
|
+
audit_log (Optional[AuditLog]):
|
|
555
|
+
Optional audit log information to create an audit entry
|
|
556
|
+
for this operation.
|
|
557
|
+
|
|
558
|
+
Returns:
|
|
559
|
+
bool:
|
|
560
|
+
Returns `True` if the operation was successful, otherwise `False`.
|
|
561
|
+
|
|
562
|
+
Raises:
|
|
563
|
+
ValueError:
|
|
564
|
+
If required arguments are missing or invalid.
|
|
565
|
+
|
|
566
|
+
RuntimeError:
|
|
567
|
+
If the server version is incompatible or if an unexpected
|
|
568
|
+
response is returned.
|
|
569
|
+
"""
|
|
570
|
+
|
|
571
|
+
return enable_subagents_action(
|
|
572
|
+
context=self._ctx,
|
|
573
|
+
controller_id=controller_id,
|
|
574
|
+
subagent_ids=subagent_ids,
|
|
575
|
+
audit_log=audit_log
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
def remove_agent(
|
|
579
|
+
self,
|
|
580
|
+
controller_id: str,
|
|
581
|
+
agent_id: str,
|
|
582
|
+
force: bool,
|
|
583
|
+
audit_log: Optional[AuditLog] = None
|
|
584
|
+
) -> bool:
|
|
585
|
+
"""
|
|
586
|
+
Remove an agent from the specified controller.
|
|
587
|
+
|
|
588
|
+
Args:
|
|
589
|
+
controller_id (str):
|
|
590
|
+
The ID of the controller from which the agent should be removed.
|
|
591
|
+
|
|
592
|
+
agent_id (str):
|
|
593
|
+
The ID of the agent to be removed.
|
|
594
|
+
|
|
595
|
+
force (bool):
|
|
596
|
+
If `True`, forces the removal.
|
|
597
|
+
|
|
598
|
+
audit_log (Optional[AuditLog]):
|
|
599
|
+
Optional audit log information to create an audit entry
|
|
600
|
+
for this operation.
|
|
601
|
+
|
|
602
|
+
Returns:
|
|
603
|
+
bool:
|
|
604
|
+
Returns `True` if the operation was successful.
|
|
605
|
+
|
|
606
|
+
Raises:
|
|
607
|
+
ValueError:
|
|
608
|
+
If required arguments are missing or invalid.
|
|
609
|
+
|
|
610
|
+
RuntimeError:
|
|
611
|
+
If the server version is incompatible or if an unexpected
|
|
612
|
+
response is returned.
|
|
613
|
+
"""
|
|
614
|
+
|
|
615
|
+
return remove_agent_action(
|
|
616
|
+
context=self._ctx,
|
|
617
|
+
controller_id=controller_id,
|
|
618
|
+
agent_id=agent_id,
|
|
619
|
+
force=force,
|
|
620
|
+
audit_log=audit_log
|
|
621
|
+
)
|
|
622
|
+
|
|
623
|
+
def revoke_cluster_agents(
|
|
624
|
+
self,
|
|
625
|
+
controller_id: str,
|
|
626
|
+
agent_ids: List[str],
|
|
627
|
+
audit_log: Optional[AuditLog] = None
|
|
628
|
+
) -> bool:
|
|
629
|
+
"""
|
|
630
|
+
Revoke cluster agents from the specified controller.
|
|
631
|
+
|
|
632
|
+
Args:
|
|
633
|
+
controller_id (str):
|
|
634
|
+
The ID of the controller from which the cluster agents
|
|
635
|
+
should be revoked.
|
|
636
|
+
|
|
637
|
+
agent_ids (List[str]):
|
|
638
|
+
A collection of cluster agent IDs to be revoked.
|
|
639
|
+
|
|
640
|
+
audit_log (Optional[AuditLog]):
|
|
641
|
+
Optional audit log information to create an audit entry
|
|
642
|
+
for this operation.
|
|
643
|
+
|
|
644
|
+
Returns:
|
|
645
|
+
bool:
|
|
646
|
+
Returns `True` if the operation was successful.
|
|
647
|
+
|
|
648
|
+
Raises:
|
|
649
|
+
ValueError:
|
|
650
|
+
If required arguments are missing or invalid.
|
|
651
|
+
|
|
652
|
+
RuntimeError:
|
|
653
|
+
If the server version is incompatible or if an unexpected
|
|
654
|
+
response is returned.
|
|
655
|
+
"""
|
|
656
|
+
|
|
657
|
+
return revoke_cluster_agents_action(
|
|
658
|
+
context=self._ctx,
|
|
659
|
+
controller_id=controller_id,
|
|
660
|
+
agent_ids=agent_ids,
|
|
661
|
+
audit_log=audit_log
|
|
662
|
+
)
|
|
663
|
+
|
|
664
|
+
def revoke_standalone_agents(
|
|
665
|
+
self,
|
|
666
|
+
controller_id: str,
|
|
667
|
+
agent_ids: List[str],
|
|
668
|
+
audit_log: Optional[AuditLog] = None
|
|
669
|
+
) -> bool:
|
|
670
|
+
"""
|
|
671
|
+
Revoke standalone agents from the specified controller.
|
|
672
|
+
|
|
673
|
+
Args:
|
|
674
|
+
controller_id (str):
|
|
675
|
+
The ID of the controller from which the standalone agents
|
|
676
|
+
should be revoked.
|
|
677
|
+
|
|
678
|
+
agent_ids (List[str]):
|
|
679
|
+
A collection of standalone agent IDs to be revoked.
|
|
680
|
+
|
|
681
|
+
audit_log (Optional[AuditLog]):
|
|
682
|
+
Optional audit log information to create an audit entry
|
|
683
|
+
for this operation.
|
|
684
|
+
|
|
685
|
+
Returns:
|
|
686
|
+
bool:
|
|
687
|
+
Returns `True` if the operation was successful.
|
|
688
|
+
|
|
689
|
+
Raises:
|
|
690
|
+
ValueError:
|
|
691
|
+
If required arguments are missing or invalid.
|
|
692
|
+
|
|
693
|
+
RuntimeError:
|
|
694
|
+
If the server version is incompatible or if an unexpected
|
|
695
|
+
response is returned.
|
|
696
|
+
"""
|
|
697
|
+
|
|
698
|
+
return revoke_standalone_agents_action(
|
|
699
|
+
context=self._ctx,
|
|
700
|
+
controller_id=controller_id,
|
|
701
|
+
agent_ids=agent_ids,
|
|
702
|
+
audit_log=audit_log
|
|
703
|
+
)
|
|
704
|
+
|
|
705
|
+
def revoke_subagent_clusters(
|
|
706
|
+
self,
|
|
707
|
+
controller_id: str,
|
|
708
|
+
subagent_cluster_ids: List[str],
|
|
709
|
+
audit_log: Optional[AuditLog] = None
|
|
710
|
+
) -> bool:
|
|
711
|
+
"""
|
|
712
|
+
Revoke subagent clusters from the specified controller.
|
|
713
|
+
|
|
714
|
+
Args:
|
|
715
|
+
controller_id (str):
|
|
716
|
+
The ID of the controller from which the subagent clusters
|
|
717
|
+
should be revoked.
|
|
718
|
+
|
|
719
|
+
subagent_cluster_ids (List[str]):
|
|
720
|
+
A collection of subagent cluster IDs to be revoked.
|
|
721
|
+
|
|
722
|
+
audit_log (Optional[AuditLog]):
|
|
723
|
+
Optional audit log information to create an audit entry
|
|
724
|
+
for this operation.
|
|
725
|
+
|
|
726
|
+
Returns:
|
|
727
|
+
bool:
|
|
728
|
+
Returns `True` if the operation was successful.
|
|
729
|
+
|
|
730
|
+
Raises:
|
|
731
|
+
ValueError:
|
|
732
|
+
If required arguments are missing or invalid.
|
|
733
|
+
|
|
734
|
+
RuntimeError:
|
|
735
|
+
If the server version is incompatible or if an unexpected
|
|
736
|
+
response is returned.
|
|
737
|
+
"""
|
|
738
|
+
|
|
739
|
+
return revoke_subagent_clusters_action(
|
|
740
|
+
context=self._ctx,
|
|
741
|
+
controller_id=controller_id,
|
|
742
|
+
subagent_cluster_ids=subagent_cluster_ids,
|
|
743
|
+
audit_log=audit_log
|
|
744
|
+
)
|
|
363
745
|
|