Skip to main content

REST API for Bareos console access.

Project description

Bareos REST API using fastAPI and python-bareos

Experimental and subject to enhancements and changes.

This is an experimental backend for development purposes.

It provides a REST API using fastapi and python-bareos to connect to a Bareos director.

Guide

Installation

We recommend to create a dedicated Python environment for the installation in an own directory:

python3 -m venv env
# Activate the virtual environment inside the directory
source env/bin/activate
# Install dependencies into the virtual environment
pip install bareos-restapi

Note: The optional module sslpsk can be installed manually, if you want encrypted communication between the API and the Bareos director.

Configuration

The module directory contains a sample ini-file. Change into this directory (something like /lib/python3.x/site-packages/bareosRestapiModels on most operating systems) and copy api.ini.sample to api.ini and adapt it to your director. Make sure to generate an own secret-key for the JWT section.

Your director configuration in api.ini should look like:

[Director]
Name=bareos-dir
Address=127.0.0.1
Port=9101

Note: you will need a named console (user/password) to acces the Bareos director using this API. Read more about Consoles here: https://docs.bareos.org/Configuration/Director.html#console-resource

Start the backend server

From inside the module directory run:

uvicorn bareos_restapi:app --reload

Browse

The Swagger UI contains documentation and online-tests. Use "authorize" to connect to your Bareos director using a named console. Read here to learn how to configure a named console: https://docs.bareos.org/Configuration/Director.html#console-resource

The Swagger documentation also contains CURL statements for all available endpoints.

Future work

The API will be extended by some methods provided by the Bareos console, that are not yet implemented. It is also planned to add delete / update options for configuration in the director and REST API. If you are interested in support and / or funding enhancements, please visit https://www.bareos.com

TODO:

  • define and document response model
  • add possibility to connect to a choice of directors
  • add start-script with ini-file name as parameter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bareos_restapi-25.0.2.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bareos_restapi-25.0.2-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file bareos_restapi-25.0.2.tar.gz.

File metadata

  • Download URL: bareos_restapi-25.0.2.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bareos_restapi-25.0.2.tar.gz
Algorithm Hash digest
SHA256 e3d3504303b88eacc97b5dd38ea442b4791f69ecb1b7f7615027829fdce1d9b0
MD5 4c54f54d6e839f896a3bced447d9c555
BLAKE2b-256 c68d43faba2bb245992ee15045d0ae3d4f7aa6b271c3bcea3bac06daef10d491

See more details on using hashes here.

Provenance

The following attestation bundles were made for bareos_restapi-25.0.2.tar.gz:

Publisher: publish-python-packages-to-pypi.yml on bareos/bareos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bareos_restapi-25.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bareos_restapi-25.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f0c8c4e1ce35705ce18f509f4436deea7b7cad0f18132ee07c3d3b023a89b4ee
MD5 564788df136a016a6ba931ba49356fd0
BLAKE2b-256 cbfb2ecb3e5104341eb8c09bc4e02ac2e8779610f7c01c61dde837d6b8083d3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bareos_restapi-25.0.2-py3-none-any.whl:

Publisher: publish-python-packages-to-pypi.yml on bareos/bareos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page