Veeam Backup for Microsoft 365 REST API wrapper for Python
Project description
Veeam Backup for Microsoft 365 Python API Wrapper
Python package for interacting with the Veeam Backup for Microsoft 365 REST API
This project is an independent, open source Python client for the Veeam Backup for Microsoft 365 REST API. It is not affiliated with, endorsed by, or sponsored by Veeam Software.
Supported Versions
| VB365 Version | API Version | Supported |
|---|---|---|
| 8.0.2.159 | v8 | ✅ |
| 7.0.0.2911 | v7 | ✅ |
| 6.0.0.367 | v6 | ✅ |
| < 6.0.0.367 | < v6 | ❌ |
How to support new API versions
- Download the OpenAPI schema into openapi_schemas
- Install the openapi-python-client package
- Run
python fix_openapi.py .\openapi_schemas\vb365_rest_{version}.json .\openapi_schemas\vb365_rest_{version}_fixed.json - Run
openapi-python-client generate --path ".\openapi_schemas\vb365_rest_{version}_fixed.json" --output-path ".\veeam_365" --overwrite - Fix any warnings/errors
- Rename the folder to match the API version (i.e.,
v8) - Add the version mapping to versions.py
- Write pytest tests
- If an older API has been deprecated, delete its folder, json, and version.py entry, then update the supported versions section of the readme
Install
From PyPi
pip install veeam-365
From Source
Clone the repository and install dependencies:
git clone https://github.com/Cenvora/veeam-365.git
cd veeam-365
pip install -e .
Usage
Recommended Usage (Smart Client)
The VeeamClient handles:
- API version routing
- Authentication
- Token refresh
- Async calls
- Operation discovery
Each packaged version can be called independently through separate imports, but this is the recommended way to use this library.
Create a client and connect
import asyncio
from veeam_365.client import VeeamClient
async def main():
vc = VeeamClient(
host="https://vb365.example.com:4443",
username="administrator",
password="SuperSecretPassword",
verify_ssl=False,
api_version="v8",
disable_antiforger_token=True
)
await vc.connect()
# use the client...
await vc.close()
asyncio.run(main())
Optional Parameters:
verify_ssl(bool, default:True): Enable/disable SSL certificate verificationdisable_antiforgery_token(bool, default:True): Disable antiforgery token requirement. Set toTruefor programmatic/API clients (recommended). Set toFalseonly if using browser-based authentication with cookies.
Call an API endpoint (async)
repos = await vc.call(
vc.api("backup_repository").backup_repository_get_repositories
)
# repos is a PageOfRESTBackupRepository model
for repo in repos.data or []:
print(repo.name)
Call any endpoint
Operations map directly to the OpenAPI layout:
api/
└── backup_repository/
└── backup_repository_get_repositories.py
Call it like this:
await vc.call(
vc.api("backup_repository").backup_repository_get_repositories
)
Or explicity:
await vc.call(
vc.api("backup_repository.backup_repository_get_repositories")
)
Pagination example
result = await vc.call(
vc.api("backup_repository").backup_repository_get_repositories,
limit=50,
offset=0,
)
Close the client
await vc.close()
Contributing
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch
- Make your changes and add tests
- Submit a pull request with a clear description
Please follow PEP8 style and include docstrings for new functions/classes.
🤝 Core Contributors
This project is made possible thanks to the efforts of our core contributors:
We’re grateful for their continued support and contributions.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veeam_365-0.2.0b1.tar.gz.
File metadata
- Download URL: veeam_365-0.2.0b1.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72a73882bb839453cdf09b8bb6bf593274e96296b3a356714060de92c1c17620
|
|
| MD5 |
3cfbaaf57114d2a4db5d2c56619e2937
|
|
| BLAKE2b-256 |
3c5194c49e9a4f9fc2186306caa865116f60c97c2a5941b706eac763df215725
|
Provenance
The following attestation bundles were made for veeam_365-0.2.0b1.tar.gz:
Publisher:
publish-on-release.yml on Cenvora/veeam-365
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veeam_365-0.2.0b1.tar.gz -
Subject digest:
72a73882bb839453cdf09b8bb6bf593274e96296b3a356714060de92c1c17620 - Sigstore transparency entry: 955806195
- Sigstore integration time:
-
Permalink:
Cenvora/veeam-365@e5164dddaae7a9efa262f7c57d60c25af449157e -
Branch / Tag:
refs/tags/v0.2.0b1 - Owner: https://github.com/Cenvora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-on-release.yml@e5164dddaae7a9efa262f7c57d60c25af449157e -
Trigger Event:
push
-
Statement type:
File details
Details for the file veeam_365-0.2.0b1-py3-none-any.whl.
File metadata
- Download URL: veeam_365-0.2.0b1-py3-none-any.whl
- Upload date:
- Size: 4.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac77f20f5f32fe10e7436a55e842660d3084ea51e84041b231b91f379b70104d
|
|
| MD5 |
71cdec0d861e35a3774966583c91d9fe
|
|
| BLAKE2b-256 |
ff5af7b598465dea5df3abdb1f14113817e1e7b16586ebf37077ea25d5bbc278
|
Provenance
The following attestation bundles were made for veeam_365-0.2.0b1-py3-none-any.whl:
Publisher:
publish-on-release.yml on Cenvora/veeam-365
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veeam_365-0.2.0b1-py3-none-any.whl -
Subject digest:
ac77f20f5f32fe10e7436a55e842660d3084ea51e84041b231b91f379b70104d - Sigstore transparency entry: 955806197
- Sigstore integration time:
-
Permalink:
Cenvora/veeam-365@e5164dddaae7a9efa262f7c57d60c25af449157e -
Branch / Tag:
refs/tags/v0.2.0b1 - Owner: https://github.com/Cenvora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-on-release.yml@e5164dddaae7a9efa262f7c57d60c25af449157e -
Trigger Event:
push
-
Statement type: