electrolyt.entry_point
======================

.. py:module:: electrolyt.entry_point


Classes
-------

.. autoapisummary::

   electrolyt.entry_point.EntryPoint
   electrolyt.entry_point.Machine


Functions
---------

.. autoapisummary::

   electrolyt.entry_point.entry_point


Module Contents
---------------

.. py:class:: EntryPoint(db: dict[str, EntryPoint], fun: collections.abc.Callable[[], None], kind: str, name: str | None = None, description: str | None = None)

   Plan Entry point.

   The class represent a valid entry point in an electrolyt plan. It's used
   also to annotate a given entry point with some additional metadata.


   .. py:attribute:: fun


   .. py:attribute:: kind


   .. py:attribute:: description
      :value: None



   .. py:attribute:: executed
      :value: False



   .. py:method:: execute() -> None

      Execute an entry point.



.. py:class:: Machine(db: dict[str, EntryPoint], fun: collections.abc.Callable[[], None], kind: str, platform: str, version: str, site: str | None = None, name: str | None = None, description: str | None = None, secure_control_plane: bool = False)

   Bases: :py:obj:`EntryPoint`


   Machine entry point.

   The class is used to declare an entry point which will be the default
   function executed on a given server. It also add some information such
   as the platform and the OS version in order to be able to simulate a plan
   execution.


   .. py:attribute:: platform


   .. py:attribute:: version


   .. py:attribute:: site
      :value: None



   .. py:attribute:: secure_control_plane
      :value: False



.. py:function:: entry_point(db: dict[str, EntryPoint], cls: collections.abc.Callable[Ellipsis, EntryPoint], kind: str, *args: Any, **kwargs: Any) -> collections.abc.Callable

   Entry point decorator.

   Declare an electrolyt entry point (e.g. a machine name, a mailserver
   preset).

   This returns the function with the following new attributes: kind, name,
   description, is_entry_point=True, and executed. Executed is a boolean set
   to False by default and changed to True when the entry point has been
   executed.

   :param db: dictionary where to register the entry point
   :param cls: class of entry point
   :param kind: entry point kind (machine name, mailserver preset, ...)
   :param args: additional information to store with the entry point
   :param kwargs: additional information to store with the entry point


