System-only config

New `ca_system_only` backend callback for reading system-only data
New `CLICON_XMLDB_SYSTEM_ONLY_CONFIG` configuration option
API: Added `system_only` parameter to clixon_xml2file1()
Cleared running on commit and inited candidate on startup with system-only data
Added callback code in main example
This commit is contained in:
Olof hagsand 2024-10-11 11:59:49 +02:00
parent aec0a5fc3f
commit 3a656fac07
15 changed files with 580 additions and 78 deletions

View file

@ -54,6 +54,7 @@ module clixon-config {
"Added options:
CLICON_YANG_DOMAIN_DIR
CLICON_YANG_USE_ORIGINAL
CLICON_XMLDB_SYSTEM_ONLY_CONFIG (tentative)
Released in Clixon 7.2";
}
revision 2024-04-01 {
@ -1194,6 +1195,15 @@ module clixon-config {
May not work together with CLICON_BACKEND_PRIVILEGES=drop and root, since
new files need to be created in XMLDB_DIR";
}
leaf CLICON_XMLDB_SYSTEM_ONLY_CONFIG {
type boolean;
default true;
description
"If set, some fields in the configuration tree are not stored to datastore.
Instead, the application must provide a mechanism to save the system-only-config
in the system via commit/system-only-config callbacks.
See also extension system-only-config in clixon-lib.yang";
}
leaf CLICON_XML_CHANGELOG {
type boolean;
default false;

View file

@ -72,7 +72,7 @@ module clixon-lib {
revision 2024-08-01 {
description
"Added: list-pagination-partial-state
Added: system-only-config extension
Added: system-only-config extension (tentative)
Released in Clixon 7.2";
}
revision 2024-04-01 {
@ -356,8 +356,11 @@ module clixon-lib {
description
"This extension marks which fields in the configuration tree should not be
saved to datastore and be removed from memory after commit.
Instead, the application provides a mechanism to save the system-only-config
in the system.
Instead, the application must provide a mechanism to save the system-only-config
in the system:
1. Mark system-only config data in YANG with this extension
2. Write a commit callback for data write
2. Write a system-only-config callback for data read
Note that the XML with these values will be remove from the datastore. The remaining XML
still needs to be valid XML wrt YANG.
An example of an invalid marking would be a list key. Because if the list keys are