clixon/apps/restconf
2018-04-22 16:53:12 +02:00
..
clixon_restconf.h mv api_return_err to restconf_lib.c 2018-04-08 16:07:24 +00:00
Makefile.in Cleaned up apps/* Makefile.in:s 2018-04-07 19:04:56 +02:00
README.md The Clixon example has changed name from routing to example affecting all config files, plugins, tests, etc. 2018-04-02 13:18:47 +02:00
restconf_lib.c * Experimental NACM RFC8341 Network Configuration Access Control Model. 2018-04-19 22:44:15 +02:00
restconf_lib.h mv api_return_err to restconf_lib.c 2018-04-08 16:07:24 +00:00
restconf_main.c * Experimental NACM RFC8341 Network Configuration Access Control Model. 2018-04-19 22:44:15 +02:00
restconf_methods.c * Fixed issue https://github.com/clicon/clixon/issues/18 RPC response issues reported by Stephen Jones at Netgate 2018-04-22 16:53:12 +02:00
restconf_methods.h * Restructure and more generic plugin API (cli,backend,restconf,netconf) 2018-04-02 10:38:53 +02:00

Clixon Restconf

Installation using Nginx

Define nginx config file/etc/nginx/sites-available/default

server {
  ...
  location /restconf {
    root /usr/share/nginx/html/restconf;
    fastcgi_pass unix:/www-data/fastcgi_restconf.sock;
    include fastcgi_params;
  }
}

Start nginx daemon

sudo /etc/init.d nginx start

Start clixon restconf daemon

olof@vandal> sudo su -c "/www-data/clixon_restconf -f /usr/local/etc/example.xml " -s /bin/sh www-data

Make restconf calls with curl

olof@vandal> curl -G http://127.0.0.1/restconf/data/interfaces
[
  {
    "interfaces": {
      "interface":[
        {
          "name": "eth0",
          "type": "eth",
          "enabled": "true",
          "name": "eth9",
          "type": "eth",
          "enabled": "true"
         }
      ]
    }
  }
]
olof@vandal> curl -G http://127.0.0.1/restconf/data/interfaces/interface/name=eth9/type
[
  {
    "type": "eth" 
  }
]

curl -sX POST -d '{"interfaces":{"interface":{"name":"eth1","type":"eth","enabled":"true"}}}' http://localhost/restconf/data

Debugging

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

Look at syslog:

tail -f /var/log/syslog | grep clixon_restconf

Send command:

curl -G http://127.0.0.1/restconf/data/*