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
- Serve the Swagger UI to explore the REST API: http://127.0.0.1:8000/docs
- Alternatively you can use the redoc format: http://127.0.0.1:8000/redoc
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bareos_restapi-23.1.0.tar.gz
.
File metadata
- Download URL: bareos_restapi-23.1.0.tar.gz
- Upload date:
- Size: 42.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb0c5643c825764dba389c13a35f781d988606a6ad80062be2feacf78269341a |
|
MD5 | 8a9d7d1b5b9bd345fcf0955e0bb646ef |
|
BLAKE2b-256 | 3b729c5a32270ba0a77b8c6a3fcda13c8d4dfc307183032bb88883e2d7345eb4 |
Provenance
The following attestation bundles were made for bareos_restapi-23.1.0.tar.gz
:
Publisher:
publish-python-packages-to-pypi.yml
on bareos/bareos
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
bareos_restapi-23.1.0.tar.gz
- Subject digest:
eb0c5643c825764dba389c13a35f781d988606a6ad80062be2feacf78269341a
- Sigstore transparency entry: 148691414
- Sigstore integration time:
- Predicate type:
File details
Details for the file bareos_restapi-23.1.0-py3-none-any.whl
.
File metadata
- Download URL: bareos_restapi-23.1.0-py3-none-any.whl
- Upload date:
- Size: 41.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1267258169c5557fd10ed9232828571b23b71fc6fe297404ed648d65312fcf21 |
|
MD5 | 11fd9fa5619a6d433393824c0a8b89b0 |
|
BLAKE2b-256 | 120faa1e1c7e6cacb209ccf51c5ffc6a5573a369dd861cee16ffbfb5336f67c4 |
Provenance
The following attestation bundles were made for bareos_restapi-23.1.0-py3-none-any.whl
:
Publisher:
publish-python-packages-to-pypi.yml
on bareos/bareos
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
bareos_restapi-23.1.0-py3-none-any.whl
- Subject digest:
1267258169c5557fd10ed9232828571b23b71fc6fe297404ed648d65312fcf21
- Sigstore transparency entry: 148691417
- Sigstore integration time:
- Predicate type: