lantz / faucetagent-old

Simple FAUCET gNMI configuration agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FAUCET gNMI Configuration Agent

Build Status

This agent exposes a simple gNMI service to configure FAUCET.

For now, it simply allows you to get or replace the entire FAUCET configuration file (e.g. faucet.yaml) via gNMI path /.

Starting up the agent

./faucetagent.py --cert agent.crt --key agent.key \
   --configfile /etc/faucet.yaml  >& faucetagent.log &

Talking to the agent using gnxi

# TLS authentication (client auth is ignored by agent atm)
AUTH="-ca ca.crt -cert client.crt -key client.key -target_name localhost"

# Extract string_val from gnmi_get output
string_val() { grep string_val: | awk -F 'string_val: "' '{printf $2;}'  |
               sed -e 's/"$//' | xargs -0 printf; }

# Fetch information about configuration schema
gnmi_capabilities $AUTH

# Fetch current configuration
gnmi_get $AUTH -xpath=/ | string_val

# Send a configuration file to FAUCET
gnmi_set $AUTH -replace=/:$(<faucet.yaml)

Simple end-to-end test using Mininet

./dependencies.sh
make
sudo make test

About

Simple FAUCET gNMI configuration agent


Languages

Language:Python 92.2%Language:Makefile 5.2%Language:Shell 2.7%