Evenger
Create EVE-NG network topology with EVE-NG API and excel file.
Requirements
For Windows, select the Add Python 3.x to PATH checkbox during installation.
Installation
pip install evenger
Usage (API)
# import Evenger
from evenger import Evenger
# define Evenger object
evenger_lab = Evenger(
eveng_server_url='http://172.18.18.18',
username='admin',
password='eve',
lab_path='my_lab_folder/my_lab'
)
# add NEW lab
evenger_lab.add_lab()
# add regular bridge (network) to topology (type: bridge)
evenger_lab.add_network(
name='Bridge_INTERNAL',
type='bridge',
left='200',
top='200'
)
# add cloud bridge (network) to topology (type: pnet0)
evenger_lab.add_network(
name='Bridge_MANAGEMENT',
type='pnet0',
left='700',
top='200'
)
# add node nokia sros
nokia_sros_cpm_node_dict = {
'image': 'timoscpm-21.10.R6',
'name': '7750_test_1',
'management_address': '10.1.1.102/24',
'timos_line': 'slot=A chassis=SR-12 card=cpm5',
'timos_license': 'ftp://172.18.18.18/sros_vSIM_R21_license_file.txt',
'left': '500',
'top': '200'
}
evenger_lab.add_node_sros_cpm(**nokia_sros_cpm_node_dict)
# add linux server
centos7_node_dict = {
'image': 'linux-centos7',
'name': 'centos7_server',
'cpu': '1',
'ram': '1024',
'left': '700',
'top': '700'
}
evenger_lab.add_node_linux(**centos7_node_dict)
# add any custom node with eve-ng node json data (e.g. Cisco XRv 9000)
cisco_xrv_json_text='''
{
"template": "xrv",
"type": "qemu",
"count": "1",
"image": "xrv-k9-6.0.1",
"name": "xrv_custom_node",
"icon": "XR.png",
"uuid": "",
"cpulimit": "undefined",
"cpu": "1",
"ram": "3072",
"ethernet": "4",
"qemu_version": "",
"qemu_arch": "",
"qemu_nic": "",
"qemu_options": "-machine type=pc,accel=kvm,usb=off -serial mon:stdio -nographic -no-user-config -nodefaults -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -realtime mlock=off -no-shutdown -boot order=c",
"ro_qemu_options": "-machine type=pc,accel=kvm,usb=off -serial mon:stdio -nographic -no-user-config -nodefaults -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -realtime mlock=off -no-shutdown -boot order=c",
"config": "0",
"delay": "0",
"console": "telnet",
"left": "200",
"top": "800",
"postfix": 0
}
'''
evenger_lab.add_node_custom(custom_json_text=cisco_xrv_json_text)
Before create any connection, all bridge and node should be already created. Do not add any node after connection.
# connect node to bridge/network
evenger_lab.connect_node_to_bridge(
node_name='7750_test_1',
node_port='1/1/1',
bridge_name='Bridge_Internal'
)
# connect node to node
evenger_lab.connect_node_to_node(
first_node='7750_test_1',
first_port='1/1/1',
second_node='7750_test_2',
second_port='1/1/2'
)
Usage (Node Configuration with Telnet)
-
Create config folder in current working directory e.g. my_config_folder.
-
Create txt file with eve-ng node name e.g. 7750_test_1.txt in config folder (node must be booted completely and supported eve-ng telnet).
-
Add cli configuration to node text file with <_EXPECT: expected-string> which depends on node cli. Below example for Nokia SROS:
_EXPECT: ogin admin _EXPECT: assword admin _EXPECT: # configure system name "7750_test_1_system_name" exit exit logout -
After add node configs to config folder (my_config_folder/7750_test_1.txt, my_config_folder/7750_test_2.txt etc.) run below python code:
# send configuration with telnet for eve-ng telnet supported node evenger_lab.config_with_telnet(config_folder='my_config_folder')
Usage (Create Topology with Excel File)
Check examples/evenger_topology.xlsx excel file in project repo. "_LAB_INFO" sheet must be filled for eve-ng access and other sheets are same as API functions use regarding eve-ng topology.
-
Run from CLI:
With pip installation, evenger command is already added to system path.
Help:
PS C:\Users\alg\desktop> evenger -h usage: evenger.py [-h] [--excel_file EXCEL_FILE] [--config_folder CONFIG_FOLDER] [--auto_start AUTO_START] [--boot_time BOOT_TIME] optional arguments: -h, --help show this help message and exit --excel_file EXCEL_FILE excel file path [e.g. my_evenger_topology.xlsx] (default: --excel_file=evenger_topology.xlsx) --config_folder CONFIG_FOLDER config folder path [e.g. my_configs_folder] (OPTIONAL default: --config_folder=configs) --auto_start AUTO_START auto start [YES or NO] (default: --auto_start=YES) --boot_time BOOT_TIME node boot time in seconds [e.g. 150] (default: --boot_time=180)Run without config file:
PS C:\Users\alg\desktop> evenger --excel_file my_evenger_topology.xlsxRun with config files folder:
PS C:\Users\alg\desktop> evenger --excel_file my_evenger_topology.xlsx --config_folder my_configs_folder -
Run from python code:
# import Evenger only, no need create Evenger object from evenger import Evenger # create topology with excel file Evenger.excel_topology( excel_filename='evenger_topology.xlsx', auto_start='YES' ) # create topology with excel and telnet configuration Evenger.excel_topology( excel_filename='evenger_topology.xlsx', auto_start='YES', config_folder='my_config_folder', node_boot_time=150 )
Metadata
Release files for evenger 2023.1.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| evenger-2023.1.16.tar.gz | 12.3 kB | Without provenance | Details for evenger-2023.1.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evenger-2023.1.16-py3-none-any.whl | Python 3 | none | any | Details for evenger-2023.1.16-py3-none-any.whl |
Total release size: 23.1 kB
Release files / evenger-2023.1.16.tar.gz
| Download URL | evenger-2023.1.16.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b6b730f865cb036428b47147324211c6e2427e572891b1824a50ac48b182089
|
|
BLAKE2b-256 checksum How to use checksums |
7f24a5faab437d023a46b8896df7f19c7a4b6f411daa70348c314bf10ef54e22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.5
|
Release files / evenger-2023.1.16-py3-none-any.whl
| Download URL | evenger-2023.1.16-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
347f34f727572e94ec78390769c5a2ef941168e8ae05faf613bfdbdf5238dcbe
|
|
BLAKE2b-256 checksum How to use checksums |
abfb51617a36da25b9a4c4110094b3f4ea35937c4b41410df3e0c9eb84e68bd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.5
|
Security for evenger 2023.1.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.