ds_resource_plugin_py_lib.common.resource.linked_service ======================================================== .. py:module:: ds_resource_plugin_py_lib.common.resource.linked_service .. autoapi-nested-parse:: **File:** ``__init__.py`` **Region:** ``ds_resource_plugin_py_lib/common/resource/linked_service`` Description ----------- Linked service models and typed properties. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/ds_resource_plugin_py_lib/common/resource/linked_service/base/index /autoapi/ds_resource_plugin_py_lib/common/resource/linked_service/enums/index /autoapi/ds_resource_plugin_py_lib/common/resource/linked_service/errors/index Classes ------- .. autoapisummary:: ds_resource_plugin_py_lib.common.resource.linked_service.LinkedService ds_resource_plugin_py_lib.common.resource.linked_service.LinkedServiceInfo ds_resource_plugin_py_lib.common.resource.linked_service.LinkedServiceSettings ds_resource_plugin_py_lib.common.resource.linked_service.LinkedServiceMethod Package Contents ---------------- .. py:class:: LinkedService Bases: :py:obj:`abc.ABC`, :py:obj:`ds_common_serde_py_lib.Serializable`, :py:obj:`Generic`\ [\ :py:obj:`LinkedServiceSettingsType`\ ] The object containing the connection information to connect with related data store. You probably want to use the subclasses and not this class directly. Known subclasses are: - SftpLinkedService - S3LinkedService - GraphQlLinkedService All required parameters must be populated in the constructor in order to send to ds-workflow-service. .. py:attribute:: id :type: uuid.UUID .. py:attribute:: name :type: str .. py:attribute:: description :type: str | None :value: None .. py:attribute:: version :type: str .. py:attribute:: settings :type: LinkedServiceSettingsType .. py:method:: __enter__() -> Self Context manager enter. :returns: The linked service. .. py:method:: __exit__(exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: types.TracebackType | None) -> None Context manager exit. :param exc_type: The type of the exception. :param exc_value: The value of the exception. :param traceback: The traceback of the exception. .. py:property:: type :type: enum.StrEnum :abstractmethod: Get the type of the linked service. :returns: The type of the linked service. .. py:property:: connection :type: Any :abstractmethod: Return the backend client or connection object. Must raise ``ConnectionError`` if ``connect()`` has not been called. :returns: The backend client, session, or connection object. :raises ConnectionError: If the connection has not been established. .. seealso:: Full contract: ``docs/LINKED_SERVICE_CONTRACT.md`` -- ``connection`` .. py:method:: connect() -> None :abstractmethod: Establish a connection to the backend data store. The result is stored internally and accessible via the ``connection`` property. :raises ConnectionError: If the connection cannot be established. :raises AuthenticationError: If credentials are invalid. :raises NotSupportedError: If the provider does not support connect. .. seealso:: Full contract: ``docs/LINKED_SERVICE_CONTRACT.md`` -- ``connect()`` .. py:method:: test_connection() -> tuple[bool, str] :abstractmethod: Verify that the connection to the backend is healthy. Does not raise on connection failure -- returns ``(False, "reason")`` instead. :returns: ``(True, "")``. On failure: ``(False, "error description")``. :rtype: A tuple ``(success, message)``. On success :raises NotSupportedError: If the provider does not support test_connection. .. seealso:: Full contract: ``docs/LINKED_SERVICE_CONTRACT.md`` -- ``test_connection()`` .. py:method:: close() -> None :abstractmethod: Release connections, sessions, or handles. Must not raise if already closed. Idempotent. .. seealso:: Full contract: ``docs/LINKED_SERVICE_CONTRACT.md`` -- ``close()`` .. py:class:: LinkedServiceInfo Bases: :py:obj:`NamedTuple` NamedTuple that represents the linked service information. .. py:attribute:: type :type: str .. py:attribute:: name :type: str .. py:attribute:: class_name :type: str .. py:attribute:: version :type: str .. py:attribute:: description :type: str | None :value: None .. py:method:: __str__() -> str Return a string representation of the linked service info. :returns: A string representation of the linked service info. .. py:property:: key :type: tuple[str, str] Return the composite key (type, version) for dictionary lookups. :returns: A tuple containing the type and version. .. py:class:: LinkedServiceSettings Bases: :py:obj:`ds_common_serde_py_lib.Serializable` The object containing the settings of the linked service. .. py:class:: LinkedServiceMethod Bases: :py:obj:`enum.StrEnum` Allowed linked service operation names. .. py:attribute:: CONNECT :value: 'connect' Establish a connection to the backend data store. .. py:attribute:: TEST_CONNECTION :value: 'test_connection' Verify that the connection to the backend is healthy.