restconf get working alpha

This commit is contained in:
Olof hagsand 2016-08-21 19:12:10 +02:00
parent ef3c98518a
commit 9552aeebbb
6 changed files with 131 additions and 998 deletions

View file

@ -381,7 +381,7 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
/* Parse db spec file */
/* Parse yang database spec file */
if (yang_spec_main(h, stdout, 0) < 0)
goto done;

View file

@ -61,7 +61,7 @@
</rpc>
*/
/* get-config help function
/*! get-config help function
* xfilter is a filter expression starting with <filter>
* only <filter type="xpath"/> supported
* needs refactoring: move the lower part (after xfilter) up to get-config or
@ -88,7 +88,7 @@
<rpc><get-config><source><candidate/></source><filter/></get-config></rpc>]]>]]>
* filter xpath + select all:
<rpc><get-config><source><candidate/></source><filter type="xpath" select="/"/></get-config></rpc>]]>]]>
* filter subnet + config:
* filter subtree + config:
<rpc><get-config><source><candidate/></source><filter type="subtree"><configuration><interfaces><interface><ipv4/></interface></interfaces></configuration></filter></get-config></rpc>]]>]]>
* filter xpath + select:
<rpc><get-config><source><candidate/></source><filter type="xpath" select="/interfaces/interface/ipv4"/></get-config></rpc>]]>]]>
@ -158,7 +158,7 @@ netconf_filter_xmldb(clicon_handle h,
"protocol",
"error",
NULL,
"<bad-attribute>select</bad-attribute>");
"<bad-attribute>select</bad-attribute>");
goto done;
}
if (xmldb_get(h, source, selector, 0, &xdb, NULL, NULL) < 0){

View file

@ -1,4 +1,5 @@
Work-in-progress restconf server
================================
See draft-ietf-netconf-restconf-13.txt
@ -26,7 +27,19 @@ server {
# pass the REST API to FastCGI server
location /restconf {
root /usr/share/nginx/html/restconf;
fastcgi_pass unix:/www-data/fastcgi_api.sock;
fastcgi_pass unix:/www-data/clicon_restconf.sock;
include fastcgi_params;
}
}
}
Debugging
---------
Start the fastcgi programs with debug flag:
sudo su -c "/www-data/clixon_restconf -D" -s /bin/sh www-data
Look at syslog:
tail -f /var/log/syslog | grep clixon_restconf
Send command:
curl -G http://127.0.0.1/restconf/data/foo

File diff suppressed because it is too large Load diff