diff options
author | Francis Dupont <fdupont@isc.org> | 2019-08-12 17:08:15 +0200 |
---|---|---|
committer | Tomek Mrugalski <tomasz@isc.org> | 2019-08-15 18:10:36 +0200 |
commit | 79d0d45ec0c791560e297ca77fc88842b0a33868 (patch) | |
tree | ca743439133524fc13714e7d4509c8f2bd0a1b51 | |
parent | [#761,!447] Updated ChangeLog (diff) | |
download | kea-79d0d45ec0c791560e297ca77fc88842b0a33868.tar.xz kea-79d0d45ec0c791560e297ca77fc88842b0a33868.zip |
[823-last-update-yang-models] Updated yang models & code for logger and database syntax updates to come
24 files changed, 62 insertions, 33 deletions
diff --git a/src/lib/yang/translator_database.cc b/src/lib/yang/translator_database.cc index b12bec4280..3527a79fba 100644 --- a/src/lib/yang/translator_database.cc +++ b/src/lib/yang/translator_database.cc @@ -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()), diff --git a/src/lib/yang/translator_database.h b/src/lib/yang/translator_database.h index aa6442c390..5354d77c76 100644 --- a/src/lib/yang/translator_database.h +++ b/src/lib/yang/translator_database.h @@ -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 /// diff --git a/src/lib/yang/translator_logger.cc b/src/lib/yang/translator_logger.cc index c0855e9e7f..e4a21d244e 100644 --- a/src/lib/yang/translator_logger.cc +++ b/src/lib/yang/translator_logger.cc @@ -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(); diff --git a/src/lib/yang/translator_logger.h b/src/lib/yang/translator_logger.h index fe9fc71c23..a820b1dbdd 100644 --- a/src/lib/yang/translator_logger.h +++ b/src/lib/yang/translator_logger.h @@ -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 diff --git a/src/lib/yang/yang_revisions.h b/src/lib/yang/yang_revisions.h index 2aa6b5d3cf..24526c5ccd 100644 --- a/src/lib/yang/yang_revisions.h +++ b/src/lib/yang/yang_revisions.h @@ -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 diff --git a/src/share/yang/modules/Makefile.am b/src/share/yang/modules/Makefile.am index 5ae20063ef..23f000c5d8 100644 --- a/src/share/yang/modules/Makefile.am +++ b/src/share/yang/modules/Makefile.am @@ -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 index 462dd3625d..0000000000 --- a/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-09.hash +++ /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 index 0000000000..bf142b8bb3 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-ctrl-agent@2019-08-12.hash @@ -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 index c7b557eaa1..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-09.hash +++ /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 index 0000000000..537b73cbf0 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp-ddns@2019-08-12.hash @@ -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 index c5a96d0b97..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-09.hash +++ /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 index 0000000000..fdea156205 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp-types@2019-08-12.hash @@ -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 index 29d94830ff..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash +++ /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 index 0000000000..3a5f1318f1 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-12.hash @@ -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 index f6be616a0d..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-09.hash +++ /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 index 0000000000..6e3ca75aa2 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp6-server@2019-08-12.hash @@ -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 index f7dad34528..0000000000 --- a/src/share/yang/modules/hashes/kea-types@2019-08-09.hash +++ /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 index 0000000000..546d6701d7 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-types@2019-08-12.hash @@ -0,0 +1 @@ +a2c7883852f3649b8d1df213f19a0d007d1652a8bc1b7262d98095905e1ae1e9 diff --git a/src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang b/src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang index f6e2e9e5e0..ff25896d07 100644 --- a/src/share/yang/modules/kea-ctrl-agent@2019-08-09.yang +++ b/src/share/yang/modules/kea-ctrl-agent@2019-08-12.yang @@ -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 ""; } diff --git a/src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang b/src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang index 6749972d32..fdffc1560f 100644 --- a/src/share/yang/modules/kea-dhcp-ddns@2019-08-09.yang +++ b/src/share/yang/modules/kea-dhcp-ddns@2019-08-12.yang @@ -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 ""; } diff --git a/src/share/yang/modules/kea-dhcp-types@2019-08-09.yang b/src/share/yang/modules/kea-dhcp-types@2019-08-12.yang index 5fc5afa363..9b86ced2a8 100644 --- a/src/share/yang/modules/kea-dhcp-types@2019-08-09.yang +++ b/src/share/yang/modules/kea-dhcp-types@2019-08-12.yang @@ -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 diff --git a/src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang b/src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang index 7ec16607fc..c3a2a7cbfa 100644 --- a/src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang +++ b/src/share/yang/modules/kea-dhcp4-server@2019-08-12.yang @@ -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 ""; } diff --git a/src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang b/src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang index 15185a3f15..ac6ef6792e 100644 --- a/src/share/yang/modules/kea-dhcp6-server@2019-08-09.yang +++ b/src/share/yang/modules/kea-dhcp6-server@2019-08-12.yang @@ -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 ""; } diff --git a/src/share/yang/modules/kea-types@2019-08-09.yang b/src/share/yang/modules/kea-types@2019-08-12.yang index ec10b54e9b..a1a46dcfba 100644 --- a/src/share/yang/modules/kea-types@2019-08-09.yang +++ b/src/share/yang/modules/kea-types@2019-08-12.yang @@ -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 { |