* clixon_restconf and clixon_netconf now take -D <level> as command-line option\
instead of just -D * This aligns to clixon_cli and clixon_backend
This commit is contained in:
parent
10ada483e5
commit
7c94991fe9
10 changed files with 18 additions and 14 deletions
|
|
@ -5,6 +5,8 @@
|
||||||
### Major New features
|
### Major New features
|
||||||
|
|
||||||
### API changes on existing features (you may need to change your code)
|
### API changes on existing features (you may need to change your code)
|
||||||
|
* clixon_restconf and clixon_netconf now take -D <level> as command-line option instead of just -D
|
||||||
|
* This aligns to clixon_cli and clixon_backend
|
||||||
* Application command option -S to clixon_netconf is obsolete. Use `clixon_netconf -l s` instead.
|
* Application command option -S to clixon_netconf is obsolete. Use `clixon_netconf -l s` instead.
|
||||||
|
|
||||||
### Minor changes
|
### Minor changes
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ usage(clicon_handle h,
|
||||||
"where commands is a CLI command or options passed to the main plugin\n"
|
"where commands is a CLI command or options passed to the main plugin\n"
|
||||||
"where options are\n"
|
"where options are\n"
|
||||||
"\t-h \t\tHelp\n"
|
"\t-h \t\tHelp\n"
|
||||||
"\t-D <level> \tDebug\n"
|
"\t-D <level> \tDebug level\n"
|
||||||
"\t-f <file> \tConfig-file (mandatory)\n"
|
"\t-f <file> \tConfig-file (mandatory)\n"
|
||||||
"\t-x\t\tDump configuration file as XML on stdout (migration utility)\n"
|
"\t-x\t\tDump configuration file as XML on stdout (migration utility)\n"
|
||||||
"\t-F <file> \tRead commands from file (default stdin)\n"
|
"\t-F <file> \tRead commands from file (default stdin)\n"
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ usage(clicon_handle h,
|
||||||
fprintf(stderr, "usage:%s\n"
|
fprintf(stderr, "usage:%s\n"
|
||||||
"where options are\n"
|
"where options are\n"
|
||||||
"\t-h\t\tHelp\n"
|
"\t-h\t\tHelp\n"
|
||||||
"\t-D\t\tDebug\n"
|
"\t-D <level>\tDebug level\n"
|
||||||
"\t-q\t\tQuiet: dont send hello prompt\n"
|
"\t-q\t\tQuiet: dont send hello prompt\n"
|
||||||
"\t-f <file>\tConfiguration file (mandatory)\n"
|
"\t-f <file>\tConfiguration file (mandatory)\n"
|
||||||
"\t-l <e|o|s|f<file>> \tLog on std(e)rr, std(o)ut, (s)yslog, (f)ile (syslog is default)\n"
|
"\t-l <e|o|s|f<file>> \tLog on std(e)rr, std(o)ut, (s)yslog, (f)ile (syslog is default)\n"
|
||||||
|
|
@ -345,7 +345,8 @@ main(int argc,
|
||||||
usage(h, argv[0]);
|
usage(h, argv[0]);
|
||||||
break;
|
break;
|
||||||
case 'D' : /* debug */
|
case 'D' : /* debug */
|
||||||
debug = 1;
|
if (sscanf(optarg, "%d", &debug) != 1)
|
||||||
|
usage(h, argv[0]);
|
||||||
break;
|
break;
|
||||||
case 'f': /* override config file */
|
case 'f': /* override config file */
|
||||||
if (!strlen(optarg))
|
if (!strlen(optarg))
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ curl -sX POST -d '{"interfaces":{"interface":{"name":"eth1","type":"eth","enable
|
||||||
|
|
||||||
Start the restconf fastcgi program with debug flag:
|
Start the restconf fastcgi program with debug flag:
|
||||||
```
|
```
|
||||||
sudo su -c "/www-data/clixon_restconf -Df /usr/local/etc/example.xml" -s /bin/sh www-data
|
sudo su -c "/www-data/clixon_restconf -D 1 f /usr/local/etc/example.xml" -s /bin/sh www-data
|
||||||
```
|
```
|
||||||
Look at syslog:
|
Look at syslog:
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
* sudo apt-get install libfcgi-dev
|
* sudo apt-get install libfcgi-dev
|
||||||
* gcc -o fastcgi fastcgi.c -lfcgi
|
* gcc -o fastcgi fastcgi.c -lfcgi
|
||||||
|
|
||||||
* sudo su -c "/www-data/clixon_restconf -Df /usr/local/etc/example.xml " -s /bin/sh www-data
|
* sudo su -c "/www-data/clixon_restconf -D 1 -f /usr/local/etc/example.xml " -s /bin/sh www-data
|
||||||
|
|
||||||
* This is the interface:
|
* This is the interface:
|
||||||
* api/data/profile=<name>/metric=<name> PUT data:enable=<flag>
|
* api/data/profile=<name>/metric=<name> PUT data:enable=<flag>
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
#include "restconf_methods.h"
|
#include "restconf_methods.h"
|
||||||
|
|
||||||
/* Command line options to be passed to getopt(3) */
|
/* Command line options to be passed to getopt(3) */
|
||||||
#define RESTCONF_OPTS "hDf:l:p:y:a:u:"
|
#define RESTCONF_OPTS "hD:f:l:p:y:a:u:"
|
||||||
|
|
||||||
/* RESTCONF enables deployments to specify where the RESTCONF API is
|
/* RESTCONF enables deployments to specify where the RESTCONF API is
|
||||||
located. The client discovers this by getting the "/.well-known/host-meta"
|
located. The client discovers this by getting the "/.well-known/host-meta"
|
||||||
|
|
@ -488,7 +488,7 @@ usage(clicon_handle h,
|
||||||
fprintf(stderr, "usage:%s [options]\n"
|
fprintf(stderr, "usage:%s [options]\n"
|
||||||
"where options are\n"
|
"where options are\n"
|
||||||
"\t-h \t\tHelp\n"
|
"\t-h \t\tHelp\n"
|
||||||
"\t-D \t\tDebug. Log to syslog\n"
|
"\t-D <level>\tDebug level\n"
|
||||||
"\t-f <file>\tConfiguration file (mandatory)\n"
|
"\t-f <file>\tConfiguration file (mandatory)\n"
|
||||||
"\t-l <s|f<file>> \tLog on (s)yslog, (f)ile (syslog is default)\n"
|
"\t-l <s|f<file>> \tLog on (s)yslog, (f)ile (syslog is default)\n"
|
||||||
"\t-d <dir>\tSpecify restconf plugin directory dir (default: %s)\n"
|
"\t-d <dir>\tSpecify restconf plugin directory dir (default: %s)\n"
|
||||||
|
|
@ -533,7 +533,8 @@ main(int argc,
|
||||||
usage(h, argv[0]);
|
usage(h, argv[0]);
|
||||||
break;
|
break;
|
||||||
case 'D' : /* debug */
|
case 'D' : /* debug */
|
||||||
debug = 1;
|
if (sscanf(optarg, "%d", &debug) != 1)
|
||||||
|
usage(h, argv[0]);
|
||||||
break;
|
break;
|
||||||
case 'f': /* override config file */
|
case 'f': /* override config file */
|
||||||
if (!strlen(optarg))
|
if (!strlen(optarg))
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
* sudo apt-get install libfcgi-dev
|
* sudo apt-get install libfcgi-dev
|
||||||
* gcc -o fastcgi fastcgi.c -lfcgi
|
* gcc -o fastcgi fastcgi.c -lfcgi
|
||||||
|
|
||||||
* sudo su -c "/www-data/clixon_restconf -Df /usr/local/etc/example.xml " -s /bin/sh www-data
|
* sudo su -c "/www-data/clixon_restconf -D 1 f /usr/local/etc/example.xml " -s /bin/sh www-data
|
||||||
|
|
||||||
* This is the interface:
|
* This is the interface:
|
||||||
* api/data/profile=<name>/metric=<name> PUT data:enable=<flag>
|
* api/data/profile=<name>/metric=<name> PUT data:enable=<flag>
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ clixon_cli=clixon_cli
|
||||||
clixon_netconf=clixon_netconf
|
clixon_netconf=clixon_netconf
|
||||||
|
|
||||||
# How to run restconf stand-alone and using valgrind
|
# How to run restconf stand-alone and using valgrind
|
||||||
#sudo su -c "/www-data/clixon_restconf -f $cfg -D" -s /bin/sh www-data
|
#sudo su -c "/www-data/clixon_restconf -f $cfg -D 1" -s /bin/sh www-data
|
||||||
#sudo su -c "valgrind --leak-check=full --show-leak-kinds=all /www-data/clixon_restconf -f $cfg -D" -s /bin/sh www-data
|
#sudo su -c "valgrind --leak-check=full --show-leak-kinds=all /www-data/clixon_restconf -f $cfg -D 1" -s /bin/sh www-data
|
||||||
|
|
||||||
#clixon_backend="valgrind --leak-check=full --show-leak-kinds=all clixon_backend"
|
#clixon_backend="valgrind --leak-check=full --show-leak-kinds=all clixon_backend"
|
||||||
clixon_backend=clixon_backend
|
clixon_backend=clixon_backend
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ new "kill old restconf daemon"
|
||||||
sudo pkill -u www-data clixon_restconf
|
sudo pkill -u www-data clixon_restconf
|
||||||
|
|
||||||
new "start restconf daemon"
|
new "start restconf daemon"
|
||||||
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang # -D
|
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang # -D 1
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ new "kill old restconf daemon"
|
||||||
sudo pkill -u www-data clixon_restconf
|
sudo pkill -u www-data clixon_restconf
|
||||||
|
|
||||||
new "start restconf daemon"
|
new "start restconf daemon"
|
||||||
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang -D
|
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg -y $fyang # -D 1
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ new "kill old restconf daemon"
|
||||||
sudo pkill -u www-data clixon_restconf
|
sudo pkill -u www-data clixon_restconf
|
||||||
|
|
||||||
new "start restconf daemon"
|
new "start restconf daemon"
|
||||||
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg # -D
|
sudo start-stop-daemon -S -q -o -b -x /www-data/clixon_restconf -d /www-data -c www-data -- -f $cfg # -D 1
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue