python-bareos Module
====================

`python-bareos` is a Python module to access a Bareos backup system.

Packages for `python-bareos` are included in the Bareos core distribution and available via https://pypi.org/project/python-bareos/.

The main functionality is to access a |dir| via its console interface.
This is the same interface as used by the :command:`bconsole` command line tool
or the |webui|.

This module is not intended for Bareos Python plugins. Bareos plugins run inside the Bareos daemons, while this module connects to the Bareos Daemon control interfaces.

The relevant classes are:

  * :py:class:`bareos.bsock.directorconsole.DirectorConsole`
  * :py:class:`bareos.bsock.directorconsolejson.DirectorConsoleJson`

Example:

.. code:: python

   >>> import bareos
   >>> directorconsole=bareos.bsock.DirectorConsole(address='localhost', port=9101, name='user1', password='secret')
   >>> print(directorconsole.call('help').decode("utf-8"))

If you want to create a command line tool, the examples in
https://github.com/bareos/bareos/tree/master/python-bareos/bin might be useful.



.. 
   The autosummary extension imports the Python files given as parameter,
   extracts the Python docstrings
   and creates corresponding RST files in the toctree directory.

   autosummary :recursive: requires Sphinx >= 3.1.
   Use the manually workaround, until the build environment can be updated to this.

.. 
   autosummary::
   :toctree: ../include/autogenerated/autosummary/python-bareos
   :caption: python-bareos
   :template: custom-module-template.rst
   :recursive:

   bareos

.. autosummary::
   :toctree: ../include/autogenerated/autosummary/python-bareos
   :template: custom-module-template.rst

   bareos
   bareos.bsock
   bareos.bsock.connectiontype
   bareos.bsock.constants
   bareos.bsock.directorconsole
   bareos.bsock.directorconsolejson
   bareos.bsock.filedaemon
   bareos.bsock.lowlevel
   bareos.bsock.protocolmessageids
   bareos.bsock.protocolmessages
   bareos.bsock.protocolversions
   bareos.bsock.tlsversionparser
   bareos.util
   bareos.util.bareosbase64
   bareos.util.password
   bareos.util.path
   bareos.exceptions


.. 
   Skip deprecated modules

   bareos.bsock.bsock
   bareos.bsock.bsockjson
