js7-client-python 2.0.1__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.
@@ -103,7 +103,6 @@ class AuthProvider:
103
103
  # Always clean up local state
104
104
  self._http_service.close()
105
105
  self._joc_version = None
106
- self._logger = None
107
106
  self._auth_cache = None
108
107
  self._access_token = None
109
108
  self._access_token_expires_at = 0.0
@@ -22,5 +22,4 @@ class Agent:
22
22
  @cached_property
23
23
  def operate(self) -> Operate:
24
24
  return Operate(context=self._ctx)
25
-
26
25
 
@@ -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.confirm_node_loss_agent_action import confirm_node_loss_agent_action
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