"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-20.0.3/python-bareos/README.rst" (14 Sep 2021, 1962 Bytes) of package /linux/misc/bareos-Release-20.0.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

python-bareos

python-bareos is a Python module to access a http://www.bareos.org backup system.

Packages for python-bareos are included in the Bareos core distribution since Bareos >= 17.2.

Optional Requirements

TLS-PSK

Since Bareos >= 18.2.4, Bareos can use TLS-PSK (Transport-Layer-Security Pre-Shared-Key) to secure its network connections.

This subset of TLS is currently not supported by the Python SSL module. To enable this feature in python-bareos the Python module sslpsk must be installed:

pip install sslpsk

Examples

Calling bareos-director user agent commands

import bareos.bsock
password = bareos.bsock.Password('secret')
directorconsole = bareos.bsock.DirectorConsole(address='localhost', port=9101, password=password)
print directorconsole.call('help')
...

To connected to a named console instead, use the name parameter:

password = bareos.bsock.Password('secret')
directorconsole=bareos.bsock.DirectorConsole(address='localhost', port=9101, name='user1', password=password)

Simple version of the bconsole in Python

import bareos.bsock
password = bareos.bsock.Password('secret')
directorconsole = bareos.bsock.DirectorConsole(address='localhost', port=9101, password=password)
directorconsole.interactive()
...

or use the included bconsole.py script:

bconsole.py --debug --name=user1 --password=secret --port 9101 localhost

Use JSON objects of the API mode 2

Requires: Bareos >= 15.2

import bareos.bsock
password = bareos.bsock.Password('secret')
directorconsole = bareos.bsock.DirectorConsoleJson(address='localhost', port=9101, password=password)
pools = directorconsole.call('list pools')
...