TranslatorDatabase::getDatabaseKea(const string& xpath) {
ConstElementPtr type = getItem(xpath + "/database-type");
if (!type) {
- // Can't happen as database-type is the key.
- isc_throw(Unexpected, "getDatabaseKea requires database-type: "
- << xpath);
+ return (ElementPtr());
}
ElementPtr result = Element::createMap();
result->set("type", type);
/// @brief getDatabase JSON for kea-dhcp[46].
///
/// @param xpath The xpath of the database.
- /// @return JSON representation of the database.
+ /// @return JSON representation of the database or null if none.
/// @throw SysrepoError when sysrepo raises an error.
isc::data::ElementPtr getDatabaseKea(const std::string& xpath);