Skip to main content

Universal vManage API

Project description

vManage-client

Python3.8

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, you just need a connection to any vManage.

Installation

pip install vmngclient

Session usage example

Our session is an extension to requests.Session designe 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
devices = [device for device in DevicesAPI(session).devices
            if device .personality == Personality.VSMART]
software_image = "viptela-20.7.2-x86_64.tar.gz"

# Upgrade
devices_payload = DeviceVersions(session, DeviceCategory.CONTROLLERS.)get_devices_current_version(devices)
software_action = SoftwareActionAPI(session, DeviceCategory.VEDGES)
software_action_id = software_action.upgrade_software(devices_payload,
    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, reporting issues, seeking support

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

vmngclient-0.7.0.tar.gz (70.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vmngclient-0.7.0-py3-none-any.whl (99.8 kB view details)

Uploaded Python 3

File details

Details for the file vmngclient-0.7.0.tar.gz.

File metadata

  • Download URL: vmngclient-0.7.0.tar.gz
  • Upload date:
  • Size: 70.3 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

Hashes for vmngclient-0.7.0.tar.gz
Algorithm Hash digest
SHA256 5e696838451ee89b56940eb0d964096da2ae598ab2f65eff19a5d78572f47be0
MD5 11dead018edcc0e8e277eba476aa6baf
BLAKE2b-256 cb6bb1e0cd495565a4ef191e95f32f2b5a5d77ec9f3b9bbda2d61a8c2ddbac64

See more details on using hashes here.

File details

Details for the file vmngclient-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: vmngclient-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 99.8 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

Hashes for vmngclient-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bb58d560c25dc0ac409e9b92a2d1026adf99dc9e86d8078fca8f0da9fc73cec
MD5 86168bf822ac832636106e99d4738b1c
BLAKE2b-256 bdb56f0b60fbb31b5df6df54a6eb8c6e533a03e0ea29c9a394fdb51888f0c8e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page