Can RESTCONF be utilised as backed for Web development

I understand from the confd user guide that JSON RPC is being provided as an interface for web development. But, am just checking to know if RESTCONF APIs can directly be interacted to make the UI development easy.

Anything can be done in software, but you would make it difficult for yourself.
In summary, the JSON-RPC API focus on WebUI interaction (used by a human being) with ConfD, while the RESTCONF API target REST machine-to-machine point-to-point communication.

Just browse the man page for the JSON-RPC API for 5 minutes and you will find things like for example:

  • JSON-RPC support the candidate datastore. RESTCONF does not. (e.g. pre-validate configuration in the candidate before a commit to the running datastore)
  • The cookie based authentication that creates sessions and transactions in sessions. RESTCONF has no session concept, so each PUT/PATCH/DELETE/YANG patch will be a commit, while with JSON-RPC you can make changes and not until you commit the changes in the transaction are they applied to CDB. And if the session or transaction fail before commit, nothing is set. (for example a commit button that you can press after you are done configuring something)
  • You get the permissions for users with JSON-RPC (for example grey fields and buttons when a user does not have privileges to change or execute something)
  • WIth JSON-RPC you get access to the complete schema as generated by the YANG model and you can get individual levels, which I demonstrated earlier. (download only the config users view on their current screen)
  • rollbacks, messages to other WebUI / CLI users, subscribe to changes in config and oper datastores, get transaction changes (diff) etc.

Thanks Cohult for the reply.
What do you mean by man page of json rpc in the above reply. Are you referring to user guide.

“man page” is short for “manual page”
In this case, see
$ man $CONFD_DIR/man/man7/jsonrpc.7
The man pages are also attached as appendixes to the UG.

Is there any demo application available on your GitHub or any where else for web interface. Other than the examples in the UG.

There is a new larger (better) example in the works (the old one was removed in ConfD 7.1). It may be possible to gain “early adopter” access to the work in progress example if you have access to ConfD support. File a ticket with support and put @josephm and @cohult as your reference.

I do see some examples in the user guide of 7.2.1
What do you mean by removed?

I am referring to the example set that comes with the full version of ConfD (not basic) under examples.confd/webui

1 Like