Universal vManage API
Project description
vManage-client
vManage client is a package for creating simple and parallel automatic requests via official vManageAPI. It is intended to serve as a multiple session handler (provider, provider as a tenant, tenant). The library is not dependent on environment which is being run in, you just need a connection to any vManage.
Installation
pip install vmngclient
Session usage example
Our session is an extension to requests.Session designed to make it easier to communicate via API calls with vManage. We provide ready to use authenticetion, you have to simply provide the vmanage url, username and password as as if you were doing it through a GUI.
from vmngclient.session import create_vManageSession
url = "example.com"
username = "admin"
password = "password123"
session = create_vManageSession(url=url, username=username, password=password)
session.get("/dataservice/device")
API usage examples
Get devices (click to expand)
devices = session.api.devices.get()
Admin Tech (click to expand)
admin_tech_file = session.api.admin_tech.generate("172.16.255.11")
admintech.download(admin_tech_file)
admintech.delete(admin_tech_file)
Speed test (click to expand)
devices = session.api.devices.get()
speedtest = session.api.speedtest.speedtest(devices[0], devices[1])
Upgrade device (click to expand)
# Prepare devices list
vsmarts = [device for device in DevicesAPI(session).devices
if device .personality == Personality.VSMART]
software_image = "viptela-20.7.2-x86_64.tar.gz"
# Upload image
session.api.repository.upload_image(software_image)
# Upgrade
software_action = SoftwareActionAPI(session, DeviceCategory.VEDGES)
software_action_id = software_action.upgrade_software(vsmarts,
InstallSpecHelper.CEDGE.value, reboot = False, sync = True, software_image=software_image)
# Check action status
wait_for_completed(session, software_action_id, 3000)
Get alarms (click to expand)
alarms = session.api.alarms.get()
Note:
To remove InsecureRequestWarning, you can include in your scripts:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
Contributing, bug reporting and feature requests
Seeking support
You can contact us by submitting issues, or directly via mail on vmngclient@cisco.com.
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 vmngclient-0.8.1.tar.gz.
File metadata
- Download URL: vmngclient-0.8.1.tar.gz
- Upload date:
- Size: 76.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1034-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48ec9068c815455f869b234bff85e172fe463feb3d8f1fcaf0a86a8da3d6186a
|
|
| MD5 |
541c9ecf5f14e3935970842be53ee501
|
|
| BLAKE2b-256 |
7ffc794fd33cf9fc0940818b6f5c66253351361d5e96f6652cc0d26399729da3
|
File details
Details for the file vmngclient-0.8.1-py3-none-any.whl.
File metadata
- Download URL: vmngclient-0.8.1-py3-none-any.whl
- Upload date:
- Size: 110.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1034-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
374ec433bc67f42721fc886c6c707cbd1ea1ac6cefc6523653f2bd5de6f0fbab
|
|
| MD5 |
a3d0786a0152be8762fea37ca8402c92
|
|
| BLAKE2b-256 |
756b5d63252343ebdc4fda545431fcef15084535a3d3746b0b6e51d5eb4b9f82
|