acex-devkit 1.8.0__tar.gz → 1.9.0__tar.gz

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.
Files changed (29) hide show
  1. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/PKG-INFO +1 -1
  2. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/pyproject.toml +1 -1
  3. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/drivers/base.py +22 -3
  4. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/README.md +0 -0
  5. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/__init__.py +0 -0
  6. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/configdiffer/__init__.py +0 -0
  7. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/configdiffer/command.py +0 -0
  8. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/configdiffer/configdiffer.py +0 -0
  9. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/configdiffer/diff.py +0 -0
  10. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/configdiffer/old_configdiffer.py +0 -0
  11. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/configdiffer/old_diff.py +0 -0
  12. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/drivers/__init__.py +0 -0
  13. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/drivers/base_driver.py +0 -0
  14. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/exceptions/__init__.py +0 -0
  15. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/__init__.py +0 -0
  16. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/acl_model.py +0 -0
  17. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/attribute_value.py +0 -0
  18. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/composed_configuration.py +0 -0
  19. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/container_entry.py +0 -0
  20. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/external_value.py +0 -0
  21. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/logging.py +0 -0
  22. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/management_connection.py +0 -0
  23. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/ned.py +0 -0
  24. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/node_response.py +0 -0
  25. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/models/spanning_tree.py +0 -0
  26. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/normalizer/__init__.py +0 -0
  27. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/normalizer/base.py +0 -0
  28. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/normalizer/engine.py +0 -0
  29. {acex_devkit-1.8.0 → acex_devkit-1.9.0}/src/acex_devkit/types/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: acex-devkit
3
- Version: 1.8.0
3
+ Version: 1.9.0
4
4
  Summary: ACE-X DevKit - Development kit for building ACE-X drivers and plugins
5
5
  License: AGPL-3.0
6
6
  Keywords: automation,devkit,sdk,drivers,plugins
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "acex-devkit"
3
- version = "1.8.0"
3
+ version = "1.9.0"
4
4
  description = "ACE-X DevKit - Development kit for building ACE-X drivers and plugins"
5
5
  authors = ["Johan Lahti <johan.lahti@acebit.se>"]
6
6
  readme = "README.md"
@@ -1,6 +1,7 @@
1
1
  """Driver base classes for ACE-X network element drivers."""
2
2
 
3
3
  from abc import ABC, abstractmethod
4
+ from contextlib import contextmanager
4
5
  from typing import Any, Dict
5
6
 
6
7
  from acex_devkit.models.node_response import NodeListItem
@@ -43,9 +44,9 @@ class RendererBase(ABC):
43
44
  class TransportBase(ABC):
44
45
  """Base class for device transport/communication.
45
46
 
46
- Each method is self-contained the driver decides internally
47
- whether to open/close sessions per call, pool connections, or
48
- make stateless requests.
47
+ Each method is self-contained, but transports may also expose
48
+ `session()` as a context manager so a caller can run multiple
49
+ operations against the same physical connection.
49
50
 
50
51
  Args:
51
52
  node: The node instance (identity, hostname, vendor, os, ned_id)
@@ -53,6 +54,16 @@ class TransportBase(ABC):
53
54
  **kwargs: Future use (credentials, options, etc.)
54
55
  """
55
56
 
57
+ @contextmanager
58
+ def session(self, connection: ManagementConnection, **kwargs):
59
+ """Open a reusable session for multiple ops on one device.
60
+
61
+ Default is a no-op: methods continue to open/close per call.
62
+ Drivers that benefit from connection reuse override this to
63
+ hold a single connection open for the duration of the block.
64
+ """
65
+ yield self
66
+
56
67
  @abstractmethod
57
68
  def get_config(self, node: NodeListItem, connection: ManagementConnection, **kwargs) -> str:
58
69
  """Fetch the full running configuration from a device."""
@@ -67,6 +78,14 @@ class TransportBase(ABC):
67
78
  """Run arbitrary commands and return output per command. Opt-in per driver."""
68
79
  raise NotImplementedError(f"{self.__class__.__name__} does not implement execute()")
69
80
 
81
+ def get_lldp_neighbors(self, node: NodeListItem, connection: ManagementConnection, **kwargs) -> list[dict]:
82
+ """Fetch LLDP/CDP neighbor table from a device.
83
+
84
+ Returns list of dicts with keys:
85
+ local_interface, remote_device, remote_interface, discovery_protocol
86
+ """
87
+ raise NotImplementedError(f"{self.__class__.__name__} does not implement get_lldp_neighbors()")
88
+
70
89
 
71
90
  class NetworkElementDriver:
72
91
  """Base class for network element drivers.
File without changes