31 : configured_globals_(
Element::createMap()),
36 :
ConfigBase(), configured_globals_(orig.configured_globals_),
37 servers_map_(orig.servers_map_), hooks_config_(orig.hooks_config_) {
44 "extractConfiguredGlobals must be given a map element");
47 for (
auto const& value : config->mapValue()) {
68 for (
auto const& serv : *ctx->getCfgServersMap()) {
81 s <<
", " << libs.size() <<
" lib(s):";
83 s << lib.first <<
" ";
105 ctx->extractConfiguredGlobals(config_set);
118 parser.
parse(ctx, cfg, check_only);
123 excuse =
"undefined configuration parsing error";
152 netconf->setValue(configured_globals_->mapValue());
154 netconf->set(
"hooks-libraries", hooks_config_.
toElement());
157 for (
auto const& serv : *servers_map_) {
159 servers->set(serv.first, server);
161 netconf->set(
"managed-servers", servers);
164 result->set(
"Netconf", netconf);
170 static list<list<string>>
const list({
171 {
"hooks-libraries",
"[]",
"parameters",
"*"},
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
An exception that is thrown if an error occurs while configuring any server.
This is a base class for exceptions thrown from the DNS library module.
The Element class represents a piece of data, used by the command channel and configuration parts.
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
isc::data::ElementPtr toElement() const
Unparse a configuration object.
isc::data::ConstElementPtr parse(isc::data::ConstElementPtr config, bool check_only) override final
Parses configuration of Netconf.
NetconfCfgMgr()
Constructor.
std::list< std::list< std::string > > jsonPathsToRedact() const override final
Return a list of all paths that contain passwords or secrets for kea-netconf.
NetconfConfigPtr getNetconfConfig()
Convenience method that returns the Netconf configuration context.
std::string getConfigSummary(const uint32_t selection) override final
Returns configuration summary in the textual format.
process::ConfigPtr createNewContext() override final
Creates a new, blank NetconfConfig context.
Netconf Configuration Context.
NetconfConfig()
Default constructor.
void extractConfiguredGlobals(isc::data::ConstElementPtr config)
Saves scalar elements from the global scope of a configuration.
isc::data::ElementPtr toElement() const override final
Unparse a configuration object.
void addConfiguredGlobal(const std::string &name, isc::data::ConstElementPtr value)
Adds a parameter to the collection configured globals.
static size_t setAllDefaults(const isc::data::ElementPtr &global)
Sets all defaults for Netconf configuration.
static size_t deriveParameters(isc::data::ElementPtr global)
Derives (inherits) all parameters from global to more specific scopes.
void parse(const NetconfConfigPtr &ctx, const isc::data::ElementPtr &config, bool check_only)
Parses the netconf configuration.
Base class for all configurations.
virtual isc::data::ElementPtr toElement() const
Converts to Element representation.
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
ElementPtr copy(ConstElementPtr from, int level)
Copy the data up to a nesting level.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
std::pair< std::string, data::ConstElementPtr > HookLibInfo
Entity that holds information about hook libraries and their parameters.
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
boost::shared_ptr< NetconfConfig > NetconfConfigPtr
Pointer to a configuration context.
isc::log::Logger netconf_logger(NETCONF_LOGGER_NAME)
Base logger for the netconf agent.
const isc::log::MessageID NETCONF_CONFIG_CHECK_FAIL
std::unordered_map< std::string, CfgServerPtr > CfgServersMap
Defines a map of CfgServers, keyed by the name.
const isc::log::MessageID NETCONF_CONFIG_FAIL
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the ConfigBase.
Defines the logger used by the top-level component of kea-lfc.
Contains declarations for loggers used by the Kea netconf agent.
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.