From 0460c093ccf4de6831f6cb43a0e6f69456929af8 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 20 Jun 2023 10:06:52 +0200 Subject: [PATCH] Moved datastore-format datastype from clixon-config.yang to clixon-lib.yang --- CHANGELOG.md | 1 + lib/src/clixon_xml_map.c | 1 + yang/clixon/clixon-config@2023-05-01.yang | 28 ++++------------------- yang/clixon/clixon-lib@2023-05-01.yang | 25 +++++++++++++++++++- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec7a9b12..4a26bd80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Expected: July 2023 * New `clixon-config@2023-05-01.yang` revision * Added options: `CLICON_CONFIG_EXTEND` + * Moved datastore-format datastype to clixon-lib * New `clixon-lib@2023-05-01.yang` revision * Restructured and extended stats rpc to schema mountpoints * rpc `` is not backward compatible diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index deddecd5..f63acac3 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -1883,6 +1883,7 @@ clixon_compare_xmls(cxobj *xc1, * @retval -1 Error * @see xml_diff which returns diff sets * @see clixon_compare_xmls which uses files and is independent of YANG + * XXX only XML */ int xml_tree_diff_print(cbuf *cb, diff --git a/yang/clixon/clixon-config@2023-05-01.yang b/yang/clixon/clixon-config@2023-05-01.yang index e0326828..a2b1842b 100644 --- a/yang/clixon/clixon-config@2023-05-01.yang +++ b/yang/clixon/clixon-config@2023-05-01.yang @@ -9,6 +9,9 @@ module clixon-config { import clixon-autocli { prefix autocli; } + import clixon-lib { + prefix cl; + } organization "Clicon / Clixon"; @@ -50,7 +53,7 @@ module clixon-config { description "Added options: CLICON_CONFIG_EXTEND - Override this yang with an application-specific extended config file + Moved datastore-format datastype to clixon-lib Released in Clixon 6.3"; } revision 2023-03-01 { @@ -281,27 +284,6 @@ module clixon-config { } } } - typedef datastore_format{ - description - "Datastore format (only xml and json implemented in actual data."; - type enumeration{ - enum xml{ - description - "Save and load xmldb as XML - More specifically, such a file looks like: ... provided - DATASTORE_TOP_SYMBOL is 'config'"; - } - enum json{ - description "Save and load xmldb as JSON"; - } - enum text{ - description "'Curly' C-like text format"; - } - enum cli{ - description "CLI format"; - } - } - } typedef datastore_cache{ description "XML configuration, ie running/candididate/ datastore cache behaviour."; @@ -947,7 +929,7 @@ module clixon-config { Others are experimental (in Clixon 5.5)"; } leaf CLICON_XMLDB_FORMAT { - type datastore_format; + type cl:datastore_format; default xml; description "XMLDB datastore format."; } diff --git a/yang/clixon/clixon-lib@2023-05-01.yang b/yang/clixon/clixon-lib@2023-05-01.yang index d23a56ae..34ef792b 100644 --- a/yang/clixon/clixon-lib@2023-05-01.yang +++ b/yang/clixon/clixon-lib@2023-05-01.yang @@ -70,7 +70,9 @@ module clixon-lib { revision 2023-05-01 { description - "Restructured and extended stats rpc to schema mountpoints"; + "Restructured and extended stats rpc to schema mountpoints + Moved datastore-format typedef from clixon-config + "; } revision 2023-03-01 { description @@ -142,6 +144,27 @@ module clixon-lib { description "Common operations that can be performed on a service"; } + typedef datastore_format{ + description + "Datastore format (only xml and json implemented in actual data."; + type enumeration{ + enum xml{ + description + "Save and load xmldb as XML + More specifically, such a file looks like: ... provided + DATASTORE_TOP_SYMBOL is 'config'"; + } + enum json{ + description "Save and load xmldb as JSON"; + } + enum text{ + description "'Curly' C-like text format"; + } + enum cli{ + description "CLI format"; + } + } + } identity snmp { description "SNMP";