Skip to main content

Module to interact with Arista CloudVision

Project description

CloudVision API (rCVP API)

This is a custom CVP API wrapper. This module works using Python2 and Python3.

Support

NOTE Always test on lab deployments before working on a production environment. Espeically between different releases of CVP and rCVP API.

This has been tested on CVP versions:

  • 2018.2.X
  • 2019.1.X
  • 2020.1.X (Beta Testing)

Usage

NOTE The documentation below is incomplete and a work in progress. This module has more functionality than what is documented. With the right supplemental data and steps, it can configure CVP from nothing to functioning.

Install using the Python Package Index

pip install rcvpapi

or

pip3 install rcvpapi

Initial Setup and Usage

from rcvpapi.rcvpapi import *

# Create connection to CloudVision
cvp_cnt = CVPCON(cvp_ip,cvp_user,cvp_user_pwd)

# Check current CloudVision sessionId/Cookie
cvp_cnt.SID

# Get the current CVP Version
cvp_cnt.version

# Logout/End session
cvp_cnt.execLogout()

# Save topology
cvp_cnt.saveTopology()

Devices/Inventory

# Get all provisioned devices
cur_inv = cvp_cnt.getDeviceInventory()

# Adds new devices to inventory/provisioning
cvp_cnt.addDeviceInventory(['10.0.0.1','10.0.0.2'])

Tasks

# Get a list of any Task type
cur_tasks = cvp_cnt.getAllTasks("Pending")

# Execute all tasks
cvp_cnt.execAllTasks("Pending")

# Get status of a task
tsk_stat = cvp_cnt.getTaskStatus(task_id)

Configlets

# Import static configlet
cvp_cnt.impConfiglet("static",configlet_name,configlet_data)

# Import configlet builder
cvp_cnt.impCofniglet("builder",configlet_name,configlet_data,configlet_form_data)

# Get all Configlets
exist_configlets = cvp_cnt.getConfiglets()

# Get a Configlet by Name
ex_cfg = cvp_cnt.getConfigletByName("Base_Authentication")

Snapshots

# Get all configured snapshots
cvp_cnt.snapshots

# Add a new snapshot
# Parameters:
#        snap_name = Name of the snapshot (required)
#        snap_cmds = Array of all commands to be included in snapshot (required)
#        snap_devices = Array of any devices to be included on the snapshot (optional)
cvp_cnt.createSnapshot(snap_name,snap_cmds,snap_devices)

Containers

# Get all containers
ex_cont = cvp_cnt.getAllContainers()

# Add a new container
cvp_cnt.addContainer(new_cont_name,parent_cont_name)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

rcvpapi-1.6.2-py2.py3-none-any.whl (22.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rcvpapi-1.6.2-py2.py3-none-any.whl.

File metadata

  • Download URL: rcvpapi-1.6.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.16

File hashes

Hashes for rcvpapi-1.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 721c40fa6c6aaf5339bc2bef719f8dcebd8a624f452380effccb5f8397dfbd3b
MD5 dbd1cb09fc1cf29a6b5d1a9db3a13962
BLAKE2b-256 e3005bb28142a713ca554adc7d5e61a9dabeab60e72dfa2f3b6941985066e608

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