AuvikNetworksConnection Class
The AuvikNetworksConnection class provides an interface to interact with the Auvik Networks API, allowing users to authenticate and retrieve data related to tenants and devices. The class includes error handling and retry logic for API requests to ensure reliability. This README provides an overview of the class's functionality, methods, and usage.
Class Summary
AuvikNetworksConnection Purpose: To authenticate and interact with the Auvik Networks API.
Command-list
get_tenants: Retrieves tenant information. get_tenant_details: Retrieves detailed information for a specific tenant. get_device_info: Retrieves device information for a specific tenant. get_auvik_devices_info: Retrieves detailed device information, with optional additional details.
Methods:
init(username: str, password: str): Initializes the connection and authenticates the user. get_tenants(json_output: bool = False): Retrieves tenant information. get_tenant_details(domain_prefix: str, json_output: bool = False): Retrieves detailed information for a specific tenant. get_auvik_devices_info(tenant_id: str = None, include_detail: bool = False, json_output: bool = False): Retrieves detailed device information with optional detail fields.
Ensure you have the necessary Python packages installed: import requests import json import pandas as pd import time
Initialization
To use the AuvikNetworksConnection class, you need to provide your Auvik username and password (API token): from auvik_networks_connection import AuvikNetworksConnection
username = "your_username" password = "your_password"
auvik_conn = AuvikNetworksConnection(username, password)
Retrieve Tenants
You can retrieve tenant information using the get_tenants method: tenants = auvik_conn.get_tenants() print(tenants) To retrieve the output in JSON format, set json_output to True: tenants_json = auvik_conn.get_tenants(json_output=True) print(tenants_json)
Retrieve Tenant Details
To get detailed information for a specific tenant:
domain_prefix = "tenant_prefix" tenant_details = auvik_conn.get_tenant_details(domain_prefix) print(tenant_details)
Retrieve Detailed Device Information
To get detailed device information, including specific fields:
detailed_device_info = auvik_conn.get_auvik_devices_info(tenant_id, include_detail=True) print(detailed_device_info) Error Handling The APIErrorHandler class is used internally to handle API errors. If the API returns an error status code, an exception will be raised with a relevant message.
Retry Logic The get method includes retry logic with three attempts in case of a request failure. The system waits 10 seconds before retrying.
Notes
Ensure that your credentials are stored securely and not hard-coded in your scripts. The get_access_token method handles the base64 encoding of credentials and authenticates with the Auvik API. Use the json_output parameter to retrieve data in JSON format if required.
Metadata
Release files for auviknetworks 1.0.3
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 | |
|---|---|---|---|---|
| auviknetworks-1.0.3.tar.gz | 7.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auviknetworks-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / auviknetworks-1.0.3.tar.gz
| Download URL | auviknetworks-1.0.3.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de0e299fcbc0932cd49a45392b92af50cf5afe19418cafd483e94cfbca3a54ef
|
|
BLAKE2b-256 checksum How to use checksums |
db6830a4f06bfd49ed96bbb0713a6a70708cf3a79c2d742dbfae374da1034c3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.4
|
Release files / auviknetworks-1.0.3-py3-none-any.whl
| Download URL | auviknetworks-1.0.3-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
227674d4e5cca98dcbe1bafa8ceb85cd4b59505555479a7ea149588dc91c5a91
|
|
BLAKE2b-256 checksum How to use checksums |
51f2db31f89900ecd369c3230e0d829769aa074d159d8733db7f4aa5ca28734d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.4
|
Security for auviknetworks 1.0.3
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.