Skip to main content

Generating and applying intent-based Network configuration from Hedera

Project description

perseus

Network Device Configuration from Hedera Hashgraph Intent

Setting up guestshell

Enable guestshell

switch# guestshell enable

Wait until the guestshell becomes active

Resize guestshell diskspace

switch# conf t
switch(config)# guestshell resize rootfs 2000
switch(config)# guestshell resize memory 2688
switch(config)# guesthshell reboot

Update DNS

[cisco@guestshell ~] $ sudo vi /etc/resolv.conf
nameserver <dns server IP address>
domain <domain that matches NX-OS configured domain>

Install Python 3.8

[cisco@guestshell ~] $ sudo yum -y install epel-release
[cisco@guestshell ~] $ sudo yum -y update
[cisco@guestshell ~] $ sudo yum -y groupinstall "Development Tools"
[cisco@guestshell ~] $ sudo yum -y install openssl-devel bzip2-devel libffi-devel xz-devel

Confirm GCC

[cisco@guestshell ~] $ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)

Install Python 3.8.12

[cisco@guestshell ~] $ sudo yum -y install wget
[cisco@guestshell ~] $ wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz
[cisco@guestshell ~] $ tar xvf Python-3.8.12.tgz
[cisco@guestshell ~] $ cd Python-3.8*/
[cisco@guestshell ~] $ ./configure --enable-optimizations
[cisco@guestshell ~] $ sudo make altinstall

Confirm install

[cisco@guestshell ~]$ python3.8 --version
Python 3.8.12
[cisco@guestshell ~] $ rm -rf Python-3.8*/
[cisco@guestshell ~] $ rm Python-3.8.12.tgz

Add Python to the Path

Cleanup

[cisco@guestshell ~] $ rm -rf Python-3.8.12
[cisco@guestshell ~] $ rm Python-3.8.12.tgz

Upgrade pip

[cisco@guestshell ~] $ /usr/bin/python -m pip install --upgrade pip

Install Java JDK

[cisco@guestshell ~] $ curl https://download.oracle.com/java/18/latest/jdk-18_linux-x64_bin.rpm --output jdk-18_linux-x64_bin.rpm
[cisco@guestshell ~] $ sudo rpm -Uvh jdk-18_linux-x64_bin.rpm
[cisco@guestshell ~] $ cat <<EOF | sudo tee /etc/profile.d/jdk18.sh
export JAVA_HOME=/usr/java/default
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
[cisco@guestshell ~] $ source /etc/profile.d/jdk18.sh
[cisco@guestshell ~] $ rm jdk-18_linux-x64_bin.rpm

Verify Java

[cisco@guestshell ~] $ java -version
java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

Setup Network3 Perseus

Install Network3_Perseus

pip install the package

[cisco@guestshell ~] $ python3.8 -m pip install network3_perseus

setup call_clid.py

[cisco@guestshell ~] $ sudo vi call_clid.py
import sys
from cli import *

if sys.argv[1] == "show running-config":
  output = cli(sys.argv[1])
else:
  output = clid(sys.argv[1])
print(output)
:wq

setup cli_configure.py

[cisco@guestshell ~] $ sudo vi cli_configure.py
import sys
from cli import *
configuration = sys.argv[1]
cli(configuration)
:wq

Configure Network3 Medusa

Configure Java

[cisco@guestshell ~] $ OPERATOR_ID={ Hedera account id }
[cisco@guestshell ~] $ OPERATOR_PRIVATE_KEY={ Hedera private key }

(Optional)

Export your Webex Room and Webex token to send alerts to Webex when Network3 Medusa writes data to Hedera export WEBEX_ROOM="Webex room id" export WEBEX_TOKEN="Webex token id"

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

network3_perseus-0.1.54.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

network3_perseus-0.1.54-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file network3_perseus-0.1.54.tar.gz.

File metadata

  • Download URL: network3_perseus-0.1.54.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for network3_perseus-0.1.54.tar.gz
Algorithm Hash digest
SHA256 53e5ff4f9c7be0b1260db0dd885b2954eadde33e13ca72abe469bb6e119dac9a
MD5 fdd48da3fef5db01930213b86ddd388d
BLAKE2b-256 a1867c5b7adb4b98efb113f4d630b1e829a9ac97c473397febdad3167f58fb74

See more details on using hashes here.

File details

Details for the file network3_perseus-0.1.54-py3-none-any.whl.

File metadata

  • Download URL: network3_perseus-0.1.54-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for network3_perseus-0.1.54-py3-none-any.whl
Algorithm Hash digest
SHA256 c61f046a44a5e076353e5a93d237254e4e4d91edd563c5e403c7873e3467dcde
MD5 5af6378c5d4ccd0f1bcd8060519a011f
BLAKE2b-256 969d29fa25fd260ce9c04397dcf80e46cad92c8a7f14d39f060b5f77bca6d6fd

See more details on using hashes here.

Supported by

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