]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[823-last-update-yang-models] Updated yang models & code for logger and database...
authorFrancis Dupont <fdupont@isc.org>
Mon, 12 Aug 2019 15:08:15 +0000 (17:08 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 15 Aug 2019 16:10:36 +0000 (18:10 +0200)
24 files changed:
src/lib/yang/translator_database.cc
src/lib/yang/translator_database.h
src/lib/yang/translator_logger.cc
src/lib/yang/translator_logger.h
src/lib/yang/yang_revisions.h
src/share/yang/modules/Makefile.am
src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash [deleted file]
src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-types@2019-08-09.hash [deleted file]
src/share/yang/modules/hashes/kea-types@2019-08-12.hash [new file with mode: 0644]
src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang [moved from src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang with 97% similarity]
src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang [moved from src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang with 98% similarity]
src/share/yang/modules/kea-dhcp-types@2019-08-12.yang [moved from src/share/yang/modules/kea-dhcp-types@2019-08-09.yang with 99% similarity]
src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang [moved from src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang with 99% similarity]
src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang [moved from src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang with 99% similarity]
src/share/yang/modules/kea-types@2019-08-12.yang [moved from src/share/yang/modules/kea-types@2019-08-09.yang with 97% similarity]

index b12bec428035b56b4b35d191c229468b2a96739c..3527a79fbac805de2b35089a278fbe6379d6fc89 100644 (file)
@@ -123,6 +123,10 @@ TranslatorDatabase::getDatabaseKea(const string& xpath) {
     if (serial_consistency) {
         result->set("serial-consistency", serial_consistency);
     }
+    ConstElementPtr max_row_errors = getItem(xpath + "/max-row-errors");
+    if (max_row_errors) {
+        result->set("max-row-errors", max_row_errors);
+    }
     ConstElementPtr context = getItem(xpath + "/user-context");
     if (context) {
         result->set("user-context", Element::fromJSON(context->stringValue()));
@@ -237,6 +241,10 @@ TranslatorDatabase::setDatabaseKea(const string& xpath,
     if (serial_consistency) {
         setItem(xpath + "/serial-consistency", serial_consistency, SR_STRING_T);
     }
+    ConstElementPtr max_row_errors = elem->get("max-row-errors");
+    if (max_row_errors) {
+        setItem(xpath + "/max-row-errors", max_row_errors, SR_UINT32_T);
+    }
     ConstElementPtr context = Adaptor::getContext(elem);
     if (context) {
         setItem(xpath + "/user-context", Element::create(context->str()),
index aa6442c3900f4ca6ccba5c97ecf04e094cc3c132..5354d77c76b784ef4b5cf5d341ec94004a19a8b7 100644 (file)
@@ -37,6 +37,7 @@ namespace yang {
 ///     "tcp-nodelay": <TCP nodelay flag>,
 ///     "consistency": <consistency level>,
 ///     "serial-consistency": <serial consistency level>,
+///     "max-row-errors": <maximum row errors>,
 ///     "user-context": { <json map> },
 ///     "comment": <comment>
 /// }
@@ -65,6 +66,7 @@ namespace yang {
 ///    +--rw tcp-nodelay?          boolean
 ///    +--rw consistency?          string
 ///    +--rw serial-consistency?   string
+///    +--rw max-row-errors?       uint32
 ///    +--rw user-context?         string
 /// @endcode
 ///
index c0855e9e7f82defe4eefa07d6d785aa05b1e9c23..e4a21d244e6ae70f64246d6cd1df3628c2a20e63 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -94,6 +94,10 @@ TranslatorLogger::getOutputOption(const string& xpath) {
     if (flush) {
         result->set("flush", flush);
     }
+    ConstElementPtr pattern = getItem(xpath + "/pattern");
+    if (pattern) {
+        result->set("pattern", pattern);
+    }
     return (result);
 }
 
@@ -176,6 +180,11 @@ TranslatorLogger::setOutputOption(const string& xpath, ConstElementPtr elem) {
         setItem(xpath + "/flush", flush, SR_BOOL_T);
         created = true;
     }
+    ConstElementPtr pattern = elem->get("pattern");
+    if (pattern) {
+        setItem(xpath + "/pattern", pattern, SR_STRING_T);
+        created = true;
+    }
     // There is no mandatory fields outside the key so force creation.
     if (!created) {
         ConstElementPtr list = Element::createList();
index fe9fc71c23eb699a39d5ac88f03bebd8d3321ee9..a820b1dbddc1fe1c60b0abf53332d4f2d2891ed2 100644 (file)
@@ -33,7 +33,8 @@ namespace yang {
 ///    "output": <output, e.g. log file name>,
 ///    "maxver": <maximum file version>,
 ///    "maxsize": <maxium file size>,
-///    "flush": <flush flag>
+///    "flush": <flush flag>,
+///    "pattern": <custom layout>
 /// }
 /// @endcode
 ///
@@ -47,6 +48,7 @@ namespace yang {
 ///     |     +--rw maxver?     uint32
 ///     |     +--rw maxsize?    uint32
 ///     |     +--rw flush?      boolean
+///     |     +--rw pattern?    string
 ///     +--rw debuglevel?       uint8
 ///     +--rw severity?         enumeration
 ///     +--rw user-context?     string
index 2aa6b5d3cf0d0cf796c073b6d941c1183778c6ab..24526c5ccd537686946bed433296a385502b4817 100644 (file)
@@ -21,12 +21,12 @@ static const std::map<std::string, std::string> YANG_REVISIONS = {
     { "ietf-dhcpv6-types", "2018-09-04" },
     { "ietf-dhcpv6-options", "2018-09-04" },
     { "ietf-dhcpv6-server", "2018-09-04" },
-    { "kea-types", "2019-08-09" },
-    { "kea-dhcp-types", "2019-08-09" },
-    { "kea-dhcp4-server", "2019-08-09" },
-    { "kea-dhcp6-server", "2019-08-09" },
-    { "kea-ctrl-agent", "2019-08-09" },
-    { "kea-dhcp-ddns", "2019-08-09" }
+    { "kea-types", "2019-08-12" },
+    { "kea-dhcp-types", "2019-08-12" },
+    { "kea-dhcp4-server", "2019-08-12" },
+    { "kea-dhcp6-server", "2019-08-12" },
+    { "kea-ctrl-agent", "2019-08-12" },
+    { "kea-dhcp-ddns", "2019-08-12" }
 };
 
 }; // end of namespace isc::yang
index 5ae20063ef3fd2ede3262bb592d4cabcc7a13a6c..23f000c5d8239c656f867fab16326d213f6ca52c 100644 (file)
@@ -10,12 +10,12 @@ yangmodules_list += ietf-dhcpv6-server@2018-09-04.yang
 yangmodules_list += ietf-dhcpv6-types@2018-09-04.yang
 yangmodules_list += ietf-inet-types@2013-07-15.yang
 yangmodules_list += ietf-yang-types@2013-07-15.yang
-yangmodules_list += kea-ctrl-agent@2019-08-09.yang
-yangmodules_list += kea-dhcp-ddns@2019-08-09.yang
-yangmodules_list += kea-dhcp-types@2019-08-09.yang
-yangmodules_list += kea-dhcp4-server@2019-08-09.yang
-yangmodules_list += kea-dhcp6-server@2019-08-09.yang
-yangmodules_list += kea-types@2019-08-09.yang
+yangmodules_list += kea-ctrl-agent@2019-08-12.yang
+yangmodules_list += kea-dhcp-ddns@2019-08-12.yang
+yangmodules_list += kea-dhcp-types@2019-08-12.yang
+yangmodules_list += kea-dhcp4-server@2019-08-12.yang
+yangmodules_list += kea-dhcp6-server@2019-08-12.yang
+yangmodules_list += kea-types@2019-08-12.yang
 yangmodules_list += keatest-module@2018-11-20.yang
 
 if HAVE_SYSREPO
diff --git a/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash b/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash
deleted file mode 100644 (file)
index 462dd36..0000000
+++ /dev/null
@@ -1 +0,0 @@
-e29c0b34abc0a747e258a30a636b2b53b41bdaaecfc199801221acbddc303ce4
diff --git a/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash b/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash
new file mode 100644 (file)
index 0000000..bf142b8
--- /dev/null
@@ -0,0 +1 @@
+5d11568b445edc65a4783f53fe5e8571af9a79b759272d4a3e4bfba994f71087
diff --git a/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash
deleted file mode 100644 (file)
index c7b557e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-8aef84678c3520ed4bb4025c5be2053ced2b58bf4d47b21a3e2bf35c40c1e9b9
diff --git a/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash
new file mode 100644 (file)
index 0000000..537b73c
--- /dev/null
@@ -0,0 +1 @@
+230145eb977108912d0015b8fb0d77bd4f53df0f4dfc317329ea5892569a7ba8
diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash
deleted file mode 100644 (file)
index c5a96d0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-d9a216058f557cb379da3022f74fee56fbd1fb60828e8c5791fbbf8b5ed9cb57
diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash
new file mode 100644 (file)
index 0000000..fdea156
--- /dev/null
@@ -0,0 +1 @@
+96c6a37dc93701ddd5a41ab0196fdbefeafba8c2d2a0503a05f34dcfd9accc3a
diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash
deleted file mode 100644 (file)
index 29d9483..0000000
+++ /dev/null
@@ -1 +0,0 @@
-d405e7acd13d6ac6f8acc3192e3462b9c550bd90ea73506a27bb133f91667edb
diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash
new file mode 100644 (file)
index 0000000..3a5f131
--- /dev/null
@@ -0,0 +1 @@
+23762bc4dbd25cbd49b8c5e9c27c0eb4a627327b26d1a339ed0022d9708dc8c8
diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash
deleted file mode 100644 (file)
index f6be616..0000000
+++ /dev/null
@@ -1 +0,0 @@
-e73af99c9b7e6bb865bc9b3df4f04ae3de5d472c8bba8dbc1b9bbda90e1383b1
diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash
new file mode 100644 (file)
index 0000000..6e3ca75
--- /dev/null
@@ -0,0 +1 @@
+cae7d4516cb6485c76ebce01dcfdb846f4b7470d932615df7e1f2eae8fa9d4f7
diff --git a/src/share/yang/modules/hashes/kea-types@2019-08-09.hash b/src/share/yang/modules/hashes/kea-types@2019-08-09.hash
deleted file mode 100644 (file)
index f7dad34..0000000
+++ /dev/null
@@ -1 +0,0 @@
-04a8d8a75027d109ae85fd6bea368d15056dc4a64fb75cb4da9be62c1dca1d98
diff --git a/src/share/yang/modules/hashes/kea-types@2019-08-12.hash b/src/share/yang/modules/hashes/kea-types@2019-08-12.hash
new file mode 100644 (file)
index 0000000..546d670
--- /dev/null
@@ -0,0 +1 @@
+a2c7883852f3649b8d1df213f19a0d007d1652a8bc1b7262d98095905e1ae1e9
similarity index 97%
rename from src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang
rename to src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang
index f6e2e9e5e004e1c850466ea75618731dee7014d9..ff25896d077e7d84f3a79103914d3b6276155885 100644 (file)
@@ -8,7 +8,7 @@ module kea-ctrl-agent {
   }
   import kea-types {
     prefix kea;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
 
   organization "Internet Systems Consortium";
@@ -16,7 +16,7 @@ module kea-ctrl-agent {
   description "This model defines a YANG data model that can be
                used to configure and manage a Kea control agent.";
 
-  revision 2019-08-09 {
+  revision 2019-08-12 {
     description "Initial revision";
     reference "";
   }
similarity index 98%
rename from src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang
rename to src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang
index 6749972d321caf3f45fa35c2d3c002c7147f04a2..fdffc1560f7bc885bc3e5ef5799617a687d3a84c 100644 (file)
@@ -8,7 +8,7 @@ module kea-dhcp-ddns {
   }
   import kea-types {
     prefix kea;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
 
   organization "Internet Systems Consortium";
@@ -16,7 +16,7 @@ module kea-dhcp-ddns {
   description "This model defines a YANG data model that can be
     used to configure and manage a Kea DHCP-DDNS server.";
 
-  revision 2019-08-09 {
+  revision 2019-08-12 {
     description "Initial revision";
     reference "";
   }
similarity index 99%
rename from src/share/yang/modules/kea-dhcp-types@2019-08-09.yang
rename to src/share/yang/modules/kea-dhcp-types@2019-08-12.yang
index 5fc5afa3632b78b13565c83a1a541807521beae0..9b86ced2a83859fb9f17193de7385798c94d201f 100644 (file)
@@ -8,14 +8,14 @@ module kea-dhcp-types {
   }
   import kea-types {
     prefix kea;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
 
   organization "Internet Systems Consortium";
   contact "kea-dev@lists.isc.org";
   description "This file defines some commonly used Kea DHCP types and
                groupings.";
-  revision 2019-08-09 {
+  revision 2019-08-12 {
     description "Initial revision";
     reference "";
   }
@@ -224,6 +224,10 @@ module kea-dhcp-types {
       type string;
       description "Serial consistency level.";
     }
+    leaf max-row-errors {
+      type uint32;
+      description "Maximum row errors (0 means unlimited).";
+   }
     uses kea:user-context {
       refine user-context {
         description "Database user context. Arbitrary JSON data can be
similarity index 99%
rename from src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang
rename to src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang
index 7ec16607fcc9cffcf5b727aba174c870caae8b44..c3a2a7cbfa7400e9dcc1fe752fff73eb73b09614 100644 (file)
@@ -8,11 +8,11 @@ module kea-dhcp4-server {
   }
   import kea-types {
     prefix kea;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
   import kea-dhcp-types {
     prefix dhcp;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
 
   organization "Internet Systems Consortium";
@@ -20,7 +20,7 @@ module kea-dhcp4-server {
   description "This model defines a YANG data model that can be
                used to configure and manage a Kea DHCPv4 server.";
 
-  revision 2019-08-09 {
+  revision 2019-08-12 {
     description "Initial revision";
     reference "";
   }
similarity index 99%
rename from src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang
rename to src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang
index 15185a3f15e2a5b563745f1e28d4b480e049d3e3..ac6ef6792e9caf5d569b602df03c805d9e0476c9 100644 (file)
@@ -8,11 +8,11 @@ module kea-dhcp6-server {
   }
   import kea-types {
     prefix kea;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
   import kea-dhcp-types {
     prefix dhcp;
-    revision-date 2019-08-09;
+    revision-date 2019-08-12;
   }
 
   organization "Internet Systems Consortium";
@@ -20,7 +20,7 @@ module kea-dhcp6-server {
   description "This model defines a YANG data model that can be
                used to configure and manage a Kea DHCPv6 server.";
 
-  revision 2019-08-09 {
+  revision 2019-08-12 {
     description "Initial revision";
     reference "";
   }
similarity index 97%
rename from src/share/yang/modules/kea-types@2019-08-09.yang
rename to src/share/yang/modules/kea-types@2019-08-12.yang
index ec10b54e9be644b448262a32533f9dca45c21c2e..a1a46dcfbae7ba02e4836344e854ab448ac9d6bc 100644 (file)
@@ -7,7 +7,7 @@ module kea-types {
   contact "kea-dev@lists.isc.org";
   description "This file defines some commonly used Kea types and groupings.";
 
-  revision 2019-08-09 {
+  revision 2019-08-12 {
     description "Initial revision";
     reference "";
   }
@@ -114,6 +114,10 @@ module kea-types {
           }
           description "Maximum version to keep a rotated output file.";
         }
+        leaf pattern {
+          type string;
+          description "Custom log layout.";
+        }
       }
       leaf debuglevel {
         type uint8 {