Added basic rfc8527 support

Added basic rfc8527 support, but without support for:
 * ds:operational
 * with-origin
 * clixon/test/test_rfc8527_*.sh

The current level of rfc8527 support is intended to allow commit
operations on the 'candidate' datastore without rewriting the 'startup'
datastore.
This commit is contained in:
Jonathan Ben-Avraham 2020-11-07 22:11:35 +02:00
parent a1f54d71ac
commit cd45f277ef
9 changed files with 152 additions and 47 deletions

View file

@ -152,7 +152,8 @@ api_data_post(clicon_handle h,
cvec *qvec,
char *data,
int pretty,
restconf_media media_out)
restconf_media media_out,
ietf_ds_t ds)
{
int retval = -1;
enum operation_type op = OP_CREATE;
@ -377,12 +378,12 @@ api_data_post(clicon_handle h,
cprintf(cbx, "<edit-config");
/* RFC8040 Sec 1.4:
* If the NETCONF server supports :startup, the RESTCONF server MUST
* automatically update the non-volatile startup configuration
* datastore, after the "running" datastore has been altered as a
* consequence of a RESTCONF edit operation.
* If this is a "data" request and the NETCONF server supports :startup,
* the RESTCONF server MUST automatically update the non-volatile startup
* configuration datastore, after the "running" datastore has been altered
* as a consequence of a RESTCONF edit operation.
*/
if (if_feature(yspec, "ietf-netconf", "startup"))
if ((IETF_DS_NONE == ds) && if_feature(yspec, "ietf-netconf", "startup"))
cprintf(cbx, " copystartup=\"true\"");
cprintf(cbx, " autocommit=\"true\"");
cprintf(cbx, "><target><candidate /></target>");