Veeam Easy Connect
Still under active development, please check back for updates
If you find any bugs please raise an issue
Veeam Easy Connect is a Python module that makes it easier to get going with Veeam APIs.
This module provides an easy way to get Authorized, and get the access token so you can get on with making useful requests.
Change log
- Bumped the Veeam Backup for Microsoft 365 to v6
- Fixed issue with API version update command
Note: I have updated this module so make it more generic over all Veeam Products. This means breaking changes to the way it was shown in the YouTube series.
Password login should work on:
- Veeam API
- Enterprise Manager (basic auth)
- AWS
- Azure
- GCP
- O365
MFA
AWS and Azure MFA tested and working.
GCP still to be tested but should work.
AWS SSO
SSO for AWS is in the module but still being worked on.
Items Not road mapped
O365 Modern App-Only Authentication is intended for Tenant access so is very restricted so is not currently planned.
Authorization code access is not currently road mapped.
Happy to have more people working on this so pull requests are welcome!
Installation
Install has now moved to Pypi!
pip install veeam_easy_connect
Update
pip install --upgrade veeam_easy_connect
How to use
Import the module via:
from veeam_easy_connect import VeeamEasyConnect
Next you need to create an instance of the object with your username and password.
username = "john@abc.com"
password = "super_secret"
vec = VeeamEasyConnect(username, password, True) # secure - checks SSL - bool is optional
vec = VeeamEasyConnect(username, password, False) # insecure - if you are using a Self-Signed Cert (not recommended)
Password Authentication
Next call the api type which is either:
- .ent_man - enterprise manager
- .aws
- .azure
- .gcp
- .vbr
- .o365
Then chain with the .login() command with the address
address = "192.168.0.123"
vec.aws().login(address)
token = vec.get_access_token()
MFA Authentication
AWS and Azure currently (GCP soon)
vec = VeeamEasyConnect(username, password)
vec.aws().login(address) # or .azure()
res_code = input("Enter MFA code: ")
vec.mfa_login(res_code) # string, no need to set the api type again
Request Methods
You can send requests directly using vec methods which wrap the Request library and pulls in the correct headers automatically.
This can be useful for single use scripts or when using Jupyter Notebooks.
address = f"https://192.168.0.123:9419/api/v1/backupInfrastructure/repositories"
res_data = vec.get(address) -> dict
res_data = vec.post(address, body_data) -> dict
res_data = vec.put(address, body_data) -> dict
All of these methods return a deserialized response. No delete method is available and is not planned.
Short Request URLs
To save some effort you can specify just the last part of the URL without the version number on APIs that use it for example:
"https://192.168.0.123:9419/api/v1/backupInfrastructure/repositories"
Can be shortened to:
"backupInfrastructure/repositories"
address = "backupInfrastructure/repositories"
res_data = vec.get(address, False)
# or
res_data = vec.get(address, full=False)
You need to pass "False" as the last or named parameter, which stands for "not full url".
Get Request Header
You can get the complete header by calling:
req_header = vec.get_request_header()
The request will include the correct API version for the type of API you are using.
To save the headers to a JSON file:
vec.save_request_header("file_name")
Get Access Token
To get just the token you can call one of the following:
token = vec.get_access_token()
or
token = vec.get_access_token_with_bearer() # adds the "Bearer " to the token (oauth)
This will grab the mfa_token from the oauth response and combine it in the code you enter into the correct body.
To save the access token data to a JSON file use:
vec.save_token("file_name")
Update port
To update the port you need to do the following:
vec.vbr()
vec.update_port("9420")
print(vec.get_port()) # check the port has changed
vec.login("address")
Update API Version
# set the API type
vec.vbr().update_api_version("1.0-rev3")
# check
print(vec.get_api_version())
Note that you cannot chain the api and port updates, you would need to do:
# set the API type
vec.vbr().update_api_version("1.0-rev3")
# Then update the port or visa-versa
vec.update_port("9420")
Examples
Please see examples of using vec in the examples folder.
Veeam API references
Metadata
Release files for veeam-easy-connect 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| veeam_easy_connect-0.8.0.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| veeam_easy_connect-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / veeam_easy_connect-0.8.0.tar.gz
| Download URL | veeam_easy_connect-0.8.0.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c012790e2390d11cf0fedaadd8369132294fae8d159bfc3dce7f95517f5e969
|
|
BLAKE2b-256 checksum How to use checksums |
1314ffbe6961277dc7597a640ce3b22d27c46054606725031e4c64b4a5b22995
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.62.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Release files / veeam_easy_connect-0.8.0-py3-none-any.whl
| Download URL | veeam_easy_connect-0.8.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8e19c0d4156abeff2726662d30dcbf133ef7b5093195f6eb11651ced99b26de
|
|
BLAKE2b-256 checksum How to use checksums |
36c22d779d600417d3200117754e871ec1bf29d92197a881a339521e441330da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.62.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Security for veeam-easy-connect 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.