The YANG model automated cli parser part of the yangcli tool can now be used from Node-RED.
apt -y install nodejs
apt -y install npm
npm install node-red -g --unsafe-perm
apt -y install libyangrpc-dev libyuma-dev
npm install @lightside-instruments/red-netconf -g --unsafe-perm
node-red
Then you can use the yangcli parser to manage your devices.
Here is export of the flow you can import and get started.
[
{
"id": "0a8abee38c7fa043",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "39b95a6e4d668c50",
"type": "netconf session",
"z": "0a8abee38c7fa043",
"name": "localhost",
"host": "127.0.0.1",
"port": 830,
"username": "y123",
"password": "yangrocks",
"privpath": "",
"pubpath": "",
"x": 480,
"y": 140,
"wires": [
[
"ecca6297b12bda6f"
]
]
},
{
"id": "0b5f1a68a17123eb",
"type": "netconf yangcli",
"z": "0a8abee38c7fa043",
"name": "yangcli> xget /",
"sessionNode": "39b95a6e4d668c50",
"commandTemplate": "xget /",
"x": 500,
"y": 380,
"wires": [
[
"ec28385db6b29292"
]
]
},
{
"id": "ec28385db6b29292",
"type": "debug",
"z": "0a8abee38c7fa043",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 480,
"y": 480,
"wires": []
},
{
"id": "ecca6297b12bda6f",
"type": "netconf yangcli",
"z": "0a8abee38c7fa043",
"name": "yangcli> replace /interfaces/interface[name='wlp2s0']/ipv4 -- mtu=1280",
"sessionNode": "39b95a6e4d668c50",
"commandTemplate": "replace /interfaces/interface[name='wlp2s0']/ipv4 -- mtu=1280",
"x": 670,
"y": 220,
"wires": [
[
"f5beae121eb66911"
]
]
},
{
"id": "f5beae121eb66911",
"type": "netconf yangcli",
"z": "0a8abee38c7fa043",
"name": "yangcli> commit",
"sessionNode": "39b95a6e4d668c50",
"commandTemplate": "commit",
"x": 500,
"y": 300,
"wires": [
[
"0b5f1a68a17123eb"
]
]
}
]
7 projects • 14 followers
Lightside Instruments AS develops open-source hardware and software instruments for test automation.
Comments