* Limited support of RFC 7895 YANG Module Library to list modules:
* That is, limited support of: ietf-yang-library.yang * For example: `<module><name>example</name><revision/></module><module><name>ietf-restconf-monitoring</name><revision>2017-01-26</revision></module>...` * Comply to RFC 8040 3.5.3.1 rule: api-identifier = [module-name ":"] identifier * The "module-name" was a no-op before. * This means that there was no difference between eg: GET /restconf/data/ietf-yang-library:modules-state and GET /restconf/data/XXXX:modules-state
This commit is contained in:
parent
0631be19cb
commit
74fc0800ae
18 changed files with 921 additions and 120 deletions
|
|
@ -68,7 +68,7 @@ curl -sX POST -d '{"interfaces":{"interface":{"name":"eth1","type":"eth","enable
|
|||
|
||||
Start the restconf fastcgi program with debug flag:
|
||||
```
|
||||
sudo su -c "/www-data/clixon_restconf -D 1 f /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:
|
||||
```
|
||||
|
|
@ -79,3 +79,13 @@ Send command:
|
|||
```
|
||||
curl -G http://127.0.0.1/restconf/data/*
|
||||
```
|
||||
|
||||
You can also run restconf in a debugger.
|
||||
```
|
||||
sudo gdb /www-data/clixon_restconf
|
||||
(gdb) run -D 1 -f /usr/local/etc/example.xml
|
||||
```
|
||||
but you need to ensure /www-data/fastcgi_restconf.sock has the following access:
|
||||
```
|
||||
rwxr-xr-x 1 www-data www-data 0 sep 22 11:46 /www-data/fastcgi_restconf.sock
|
||||
```
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* This program should be run as user www-data
|
||||
*
|
||||
* See draft-ietf-netconf-restconf-13.txt [draft]
|
||||
|
||||
* sudo apt-get install libfcgi-dev
|
||||
|
|
@ -46,6 +48,10 @@
|
|||
* api/test
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -615,7 +621,13 @@ main(int argc,
|
|||
/* Parse yang database spec file */
|
||||
if (yang_spec_main(h) == NULL)
|
||||
goto done;
|
||||
|
||||
/* Add system modules */
|
||||
if (yang_spec_append(h, CLIXON_DATADIR, "ietf-restconf-monitoring", NULL)< 0)
|
||||
goto done;
|
||||
if (yang_spec_append(h, CLIXON_DATADIR, "ietf-netconf-notification", NULL)< 0)
|
||||
goto done;
|
||||
if (yang_spec_append(h, CLIXON_DATADIR, "ietf-yang-library", NULL)< 0)
|
||||
goto done;
|
||||
/* Call start function in all plugins before we go interactive
|
||||
Pass all args after the standard options to plugin_start
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue