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 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 = session.api.devices.get().filter(personality = Personality.VSMART)
image = "viptela-20.7.2-x86_64.tar.gz"

# Upload image
session.api.repository.upload_image(software_image)

# Install software

install_task = session.api.software.install(devices = vsmarts,
    image= image)

# Check action status
install_task.wait_for_completed()
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

vmngclient-0.8.2.tar.gz (80.7 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.8.2-py3-none-any.whl (116.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vmngclient-0.8.2.tar.gz
  • Upload date:
  • Size: 80.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1035-azure

File hashes

Hashes for vmngclient-0.8.2.tar.gz
Algorithm Hash digest
SHA256 2866161b76fd5116aee20fbabbcc994cf5e834b2cf02a561cdb057f9644e2702
MD5 c2e5f2192daa5518d91bd6e5161ced1a
BLAKE2b-256 796742d3c14464d3351f60c7c0c348f30e9287e1fb93a0c1149f94eb64177d20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vmngclient-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 116.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.16 Linux/5.15.0-1035-azure

File hashes

Hashes for vmngclient-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9909dfda5e1881fd4386d6f57a71d34fc1e71530fa84bec837761f8f6401c35a
MD5 2c44aafd0d3272bb40a47d4911f8b1b5
BLAKE2b-256 e4559721c18448f33c2a22219314b5a7a06f669f39e66d30f2abb3f9c459e4a0

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