System-only-config

* Fix startup diff
* Add system-only to running on startup
* JSON support:
This commit is contained in:
Olof hagsand 2024-10-16 13:46:47 +02:00
parent 3a656fac07
commit 69b65ad13d
19 changed files with 276 additions and 105 deletions

View file

@ -120,7 +120,7 @@ yang_patch_xml2json_modified_cbuf(cxobj *x_simple_patch)
if (json_simple_patch == NULL)
return NULL;
cb = cbuf_new();
if (clixon_json2cbuf(cb, x_simple_patch, 0, 0) < 0)
if (clixon_json2cbuf(cb, x_simple_patch, 0, 0, 0) < 0)
goto done;
// Insert a '[' after the first '{' to get the JSON to match what api_data_post/write() expect
@ -271,7 +271,7 @@ yang_patch_do_replace(clixon_handle h,
}
}
// Convert the data to json
if (clixon_json2cbuf(json_simple_patch, x_simple_patch, 0, 0) < 0)
if (clixon_json2cbuf(json_simple_patch, x_simple_patch, 0, 0, 0) < 0)
goto done;
// Send the POST request
@ -336,7 +336,7 @@ yang_patch_do_create(clixon_handle h,
xml_addsub(x_simple_patch, value_vec_tmp);
}
}
if (clixon_json2cbuf(cb, x_simple_patch, 0, 0) < 0)
if (clixon_json2cbuf(cb, x_simple_patch, 0, 0, 0) < 0)
goto done;
if (api_data_post(h, req, cbuf_get(simple_patch_request_uri),
pi, qvec,
@ -492,7 +492,7 @@ yang_patch_do_merge(clixon_handle h,
xml_addsub(x_simple_patch, value_vec_tmp);
}
cbuf_reset(cb); /* reuse cb */
if (clixon_json2cbuf(cb, x_simple_patch, 0, 0) < 0)
if (clixon_json2cbuf(cb, x_simple_patch, 0, 0, 0) < 0)
goto done;
if ((json_simple_patch = yang_patch_xml2json_modified_cbuf(x_simple_patch)) == NULL)