A Python library that simplifies interaction with the OmniVista API, enabling easy authentication, device management, and performance data querying.
Project description
omnivista_py
omnivista_py
is a Python library that simplifies interaction with the OmniVista API. It allows easy authentication with a username and password, management of network devices, and querying of performance data. With integrated error handling and optional logging, the client provides developers with an effective tool for automating and monitoring network infrastructures.
Installation
To install the library, use pip:
pip install omnivista_py
Usage
Initialization
First, initialize the OVClient
with the base URL of the API, username, password, and optional parameters for SSL verification and logging.
from omnivista_py import OVClient
client = OVClient(
url="https://omnivista.company.de",
username="your_username",
password="your_password",
verify=True, # Optional, default is True
log=True # Optional, default is False
)
Authentication
Log in to the API:
client.login()
Device Management
Get All Devices
Retrieve a list of all devices:
devices = client.get_all_devices()
Device Information
Create a Device
instance and retrieve various information:
device = client.Device(client, ip_address="192.168.1.1")
# Get all information
info = device.get_all_information()
# Get specific details
hostname = device.get_hostname()
ip_address = device.get_ip_address()
mac_address = device.get_mac_address()
model_name = device.get_model_name()
running_directory = device.get_running_directory()
location = device.get_location()
description = device.get_description()
software_version = device.get_software_version()
software_version_advanced = device.get_software_version_advanced()
ip_interfaces = device.get_ip_interfaces()
Error Handling
The library includes custom exceptions for error handling:
APIClientError
: Base class for exceptions in this module.AuthenticationError
: Raised for authentication-related errors.DeviceRetrievalError
: Raised when retrieving devices fails.LoginError
: Raised when login fails.
Example:
try:
client.login()
except LoginError as e:
print(f"Login failed: {e}")
License
This project is licensed under the MIT License.
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 omnivista_py-0.3.6.tar.gz
.
File metadata
- Download URL: omnivista_py-0.3.6.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1347a07ba1ae4a3514bd426468e832f704e484f046c1854499b760c899c2a5d2 |
|
MD5 | 5c445d88ee48d0cc29fc4d12801ffc89 |
|
BLAKE2b-256 | 1f61f45957c07bd8a72006ba6712052ebeb48c131b593b7f63f25f0e9f51a108 |
File details
Details for the file omnivista_py-0.3.6-py3-none-any.whl
.
File metadata
- Download URL: omnivista_py-0.3.6-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25502c189ad011b68b21ccaeccedc1090b88ce8bb310f9527e35779b353f0cda |
|
MD5 | 97cadcee2a5b502c79e48ab4969de1d1 |
|
BLAKE2b-256 | 1b445f5366e61a01fa6d17e9bb1aa02375d813df6025e627e1c71b0287978aeb |