This release is a pre-release and may not be stable for production use.
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
Release files for bareos-restapi 21.0.0.dev851
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bareos-restapi-21.0.0.dev851.tar.gz | 30.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bareos_restapi-21.0.0.dev851-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.1 kB
Release files / bareos-restapi-21.0.0.dev851.tar.gz
| Download URL | bareos-restapi-21.0.0.dev851.tar.gz |
|---|---|
| Size | 30.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db27cd88ee56cf351353624853ef77449dcd0e9bec6a89ab5f3fc49674fff60a
|
|
BLAKE2b-256 checksum How to use checksums |
875e7809d155dee17e06dd0d3f2bdda6d55155560e3a50c473e9b15a622cb389
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Release files / bareos_restapi-21.0.0.dev851-py3-none-any.whl
| Download URL | bareos_restapi-21.0.0.dev851-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
558dc2cb3355fb01111112cb6658a764ba3ba32bd95c4791a5b5ba1c25345926
|
|
BLAKE2b-256 checksum How to use checksums |
ecf01bd2166701c15cb9bb0dc51e3a4ec33a7291c7f30e33a724a3c8c3b5dc0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|