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";
139 "Configuration check successful");
142 "Configuration applied successfully.");
154 netconf->setValue(configured_globals_->mapValue());
156 netconf->set(
"hooks-libraries", hooks_config_.toElement());
159 for (
auto const& serv : *servers_map_) {
161 servers->set(serv.first,
server);
163 netconf->set(
"managed-servers", servers);
172 static list<list<string>>
const list({
173 {
"hooks-libraries",
"[]",
"parameters",
"*"},
when the call the UDPServer carries on at the same position As a result
it forwards queries to a single upstream resolver and passes the answers back to the client It is constructed with the address of the forward server Queries are initiated with the question to ask the forward server
it forwards queries to a single upstream resolver and passes the answers back to the client It is constructed with the address of the forward server Queries are initiated with the question to ask the forward a buffer into which to write the answer
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
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.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The Element class represents a piece of data, used by the command channel and configuration parts.
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.
DCfgMgrBase(ConfigPtr context)
Constructor.
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.