Python package to simplify working with Comware7 Based devices
Project description
Python Comware7 Ansible Library
Python library for integrating Ansible with the Comware7 embedded system, enabling automation of inventory and device orchestration.
Installation
Create a new virtual environment
python -m venv .venv
source .venv/bin/activate
Install the package
pip install pycw7-ansible
Usage
Import Libraries
First of all, import the libraries of comware 7 connection and vlan features.
>>> from pycw7_ansible.comware import COM7
>>> from pycw7_ansible.features.vlan import Vlan
Open Connection
To open a connection, you need to create a dictionary with the device parameters and pass it to the COM7 class, then call the open method, as shown below:
>>> HOST_IP = "10.100.73.119"
>>> USERNAME = "ped"
>>> PASSWORD = "Admin@1234"
>>> PORT = 830
>>> args = dict(host=HOST_IP, username=USERNAME, password=PASSWORD, port=PORT)
>>> device = COM7(**args)
>>> device.open()
<ncclient.manager.Manager object at 0x7c5536f51d60>
Getting Example Configuration
To get the configuration of a feature, you need to create an instance of the feature class and call the get_config method, as shown below:
>>> vlan1 = Vlan(device, "1")
>>> config = vlan1.get_config()
>>> print(config)
{'vlanid': '1', 'name': 'VLAN 0001', 'descr': 'VLAN-1-MANAGEMENT'}
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 pycw7_ansible-1.0.0.tar.gz.
File metadata
- Download URL: pycw7_ansible-1.0.0.tar.gz
- Upload date:
- Size: 160.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1452cf1d4c3f66b13031b3cbe56b149f146a10096493e4f22e4e0abcddf148e
|
|
| MD5 |
b8f03b10dc31ec8ac66abf2944a21c84
|
|
| BLAKE2b-256 |
7199cbbd3067594262feb4d025ae080429b577de5ef4337d361f791a356bfdba
|
File details
Details for the file pycw7_ansible-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pycw7_ansible-1.0.0-py3-none-any.whl
- Upload date:
- Size: 308.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30ee60cfd19392045b73ee6f43a4d91868cef33b53b46e6992127b62ef347594
|
|
| MD5 |
773ed848d5f8722fde6d363ba0094cc6
|
|
| BLAKE2b-256 |
8839d7b018c1c44e7486a1eb9b41ad2712b6fb127f04ef78dc29370991c9558d
|