Warning: This document is for the development version of Bareos Documentation. The main version is bareos-23.

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 Bareos Director via its console interface. This is the same interface as used by the bconsole command line tool or the Bareos 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 constrol interfaces.

The relevant classes are:

Example:

>>> 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/blob/master/python-bareos/bin/ might be useful.

bareos

python-bareos module.

bareos.bsock

Module to access a http://www.bareos.org backup system.

bareos.bsock.connectiontype

Constants for the different Bareos connection types.

bareos.bsock.constants

Constants used by Bareos.

bareos.bsock.directorconsole

Send and receive the response to Bareos Director Daemon Console interface.

bareos.bsock.directorconsolejson

Communicate with the Bareos Director Daemon Console interface in API mode 2 (JSON).

bareos.bsock.filedaemon

Send and receive the response to Bareos File Daemon (bareos-fd).

bareos.bsock.lowlevel

Low Level socket methods to communicate with a Bareos Daemon.

bareos.bsock.protocolmessageids

Protocol Message Ids

bareos.bsock.protocolmessages

Protocol messages between bareos-director and user-agent.

bareos.bsock.protocolversions

Bareos Protocol Versions.

bareos.bsock.tlsversionparser

Classes to parse TLS version paramters.

bareos.util

Bareos utility classes.

bareos.util.bareosbase64

Bareos specific base64 implementation.

bareos.util.password

Handle Bareos passwords.

bareos.util.path

Handle file paths.

bareos.exceptions

Bareos specific exceptions.