Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

One of the main questions is: How many NetConf-Servers are configured and what it the connection-status to each NetConf-Server.

#!/bin/bash
protocol=http     # http or https
fqdn=10.20.6.29 # This is a machine of OSNL (OpenSDN/NFV lab) used for testing the commands
httpPort=8181
odlAaaUserName=demx8as6
odlAaaUserPassword=************

login="-u $odlAaaUserName:$odlAaaUserPassword"
header='--header "Content-Type: application/json"'
baseUrl="$protocol://$fqdn:$httpPort"

echo "List configured mountpoints";
odlMountpointsUrl=$baseUrl/restconf/config/network-topology:network-topology
curl $login $header $odlMountpointsUrl | python -m json.tool | grep node-id
echo
echo "List connection-status of mountpoints";
odlMountpointsUrl=$baseUrl/restconf/operational/network-topology:network-topology
curl $login $header $odlMountpointsUrl | python -m json.tool | grep connection-status
echo