https://github.com/faucetsdn/faucetagent
gNMI agent for faucet configuration
https://github.com/faucetsdn/faucetagent
Last synced: 2 months ago
JSON representation
gNMI agent for faucet configuration
- Host: GitHub
- URL: https://github.com/faucetsdn/faucetagent
- Owner: faucetsdn
- Created: 2019-04-08T20:41:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T13:06:12.000Z (2 months ago)
- Last Synced: 2025-03-17T14:25:39.540Z (2 months ago)
- Language: Python
- Size: 94.7 KB
- Stars: 6
- Watchers: 6
- Forks: 3
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### FAUCET gNMI Configuration Agent
[![Build/Test Status][1]][2]
This agent exposes a simple gNMI service to configure [FAUCET][3].
Requires FAUCET version 1.9.3 or later.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][4]
# 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=/:"$(