"type": "memfile"
},
- // Note there is hosts-database defined. RADIUS and Host Cache libraries
+ // Note there is hosts-databases defined. RADIUS and Host Cache libraries
// will create them dynamically.
// RADIUS uses flex-id reservations, so restrict Kea to use flex-id only.
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
- "hosts-database": {
+ "hosts-databases": [ {
"type": "mysql",
"reconnect-wait-time": 3000, // expressed in ms
"max-reconnect-tries": 3,
"cert-file": "my-cert",
"key-file": "my-key",
"cipher-list": "AES"
- },
+ } ],
// Since Kea.2.7.4, the libdhcp_mysql.so hook library must be loaded in order to
// store host reservations in the MySQL Host Database Backend.
// Specify the host backend hook library location.
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
-// The database specification can go into one hosts-database entry for
-// backward compatibility or be listed in hosts-databases list.
+// The database specification can be listed in hosts-databases list.
"hosts-databases": [
{
"type": "postgresql",
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
- "hosts-database": {
+ "hosts-databases": [ {
"type": "mysql",
"reconnect-wait-time": 3000, // expressed in ms
"max-reconnect-tries": 3,
"cert-file": "my-cert",
"key-file": "my-key",
"cipher-list": "AES"
- },
+ } ],
// Since Kea.2.7.4, the libdhcp_mysql.so hook library must be loaded in order to
// store host reservations in the MySQL Host Database Backend.
// Specify the host backend hook library location.
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
-// The database specification can go into one hosts-database entry for
-// backward compatibility or be listed in hosts-databases list.
+// The database specification canbe listed in hosts-databases list.
"hosts-databases": [
{
"type": "postgresql",
- To expand the local network, adding a MySQL or PostgreSQL database is a popular solution.
Users can choose to store leases, host reservations, and even most of the configuration
- in a database. See :ref:`admin` and the ``lease-database``, ``hosts-database``, and
+ in a database. See :ref:`admin` and the ``lease-database``, ``hosts-databases``, and
``config-control`` parameters in :ref:`dhcp4`.
- To provide more insight into how the DHCP server operates, Kea's RESTful API can query
::
"Dhcp4": {
- "hosts-database": {
+ "hosts-databases": [ {
"type": "mysql",
"name": "kea",
"user": "kea",
"password": "1234",
"host": "localhost",
"port": 3306
- }
+ } ]
}
Depending on the database configuration, many of the
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hosts database configuration is controlled through the
-``Dhcp4``/``hosts-database`` parameters. If enabled, the type of database must
-be set to ``mysql`` or ``postgresql``.
+``Dhcp4``/``hosts-databases`` parameters. If enabled, the type of database must
+be set to a valid type e.g. ``mysql`` or ``postgresql``.
::
- "Dhcp4": { "hosts-database": { "type": "mysql", ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "type": "mysql", ... } ], ... }
+
+Since the multiple-storage extension the database configurations must be
+placed in a ``hosts-databases`` list.
+
+.. note::
+
+ The previous keyword ``hosts-database`` which takes one database
+ configuration only is deprecated and will be rejected by a future release.
+
Next, the name of the database to hold the reservations must be set;
this is the name used when the lease database was created (see
::
- "Dhcp4": { "hosts-database": { "name": "database-name" , ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "name": "database-name" , ... } ], ... }
If the database is located on a different system than the DHCPv4 server,
the database host name must also be specified:
::
- "Dhcp4": { "hosts-database": { "host": remote-host-name, ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "host": remote-host-name, ... } ], ... }
Normally, the database is on the same machine as the DHCPv4 server.
In this case, set the value to the empty string:
::
- "Dhcp4": { "hosts-database": { "host" : "", ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "host" : "", ... } ], ... }
Should the database use a port different than the default, it may be
specified as well:
::
- "Dhcp4": { "hosts-database": { "port" : 12345, ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "port" : 12345, ... } ], ... }
The maximum number of times the server automatically attempts to
reconnect to the host database after connectivity has been lost may be
::
- "Dhcp4": { "hosts-database": { "max-reconnect-tries" : number-of-tries, ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "max-reconnect-tries" : number-of-tries, ... } ], ... }
If the server is unable to reconnect to the database after making the
maximum number of attempts, the server will exit. A value of 0 (the
::
- "Dhcp4": { "hosts-database": { "reconnect-wait-time" : number-of-milliseconds, ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "reconnect-wait-time" : number-of-milliseconds, ... } ], ... }
The default value for MySQL and PostgreSQL is 0, which disables automatic
recovery and causes the server to exit immediately upon detecting the
::
- "Dhcp4": { "hosts-database": { "on-fail" : "stop-retry-exit", ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "on-fail" : "stop-retry-exit", ... } ], ... }
The possible values are:
::
- "Dhcp4": { "hosts-database": { "retry-on-startup" : true, ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "retry-on-startup" : true, ... } ], ... }
During server startup, the inability to connect to any of the configured
backends is considered fatal only if ``retry-on-startup`` is set to ``false``
::
"Dhcp4": {
- "hosts-database": {
+ "hosts-databases": [ {
"user": "user-name",
"password": "1234",
...
- },
+ } ],
...
}
If there is no password to the account, set the password to the empty
string ``""``. (This is the default.)
-The multiple-storage extension uses a similar syntax; a configuration is
-placed into a ``hosts-databases`` list instead of into a ``hosts-database``
-entry, as in:
-
-::
-
- "Dhcp4": { "hosts-databases": [ { "type": "mysql", ... }, ... ], ... }
-
If the same host is configured both in-file and in-database, Kea does not issue a warning,
as it would if both were specified in the same data source.
Instead, the host configured in-file has priority over the one configured
::
- "Dhcp4": { "hosts-database": { "readonly": true, ... }, ... }
+ "Dhcp4": { "hosts-databases": [ { "readonly": true, ... } ], ... }
Setting this parameter to ``false`` configures the database backend to
operate in "read-write" mode, which is also the default configuration if
::
"Dhcp6": {
- "hosts-database": {
+ "hosts-databases": [ {
"type": "mysql",
"name": "kea",
"user": "kea",
"password": "1234",
"host": "localhost",
"port": 3306
- }
+ } ]
}
Depending on the database configuration, many of the
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hosts database configuration is controlled through the
-``Dhcp6``/``hosts-database`` parameters. If enabled, the type of database must
-be set to ``mysql`` or ``postgresql``.
+``Dhcp6``/``hosts-databases`` parameters. If enabled, the type of database must
+be set to a valid type e.g. ``mysql`` or ``postgresql``.
::
- "Dhcp6": { "hosts-database": { "type": "mysql", ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "type": "mysql", ... } ], ... }
+
+Since the multiple-storage extension the database configurations must be
+placed in a ``hosts-databases`` list.
+
+.. note::
+
+ The previous keyword ``hosts-database`` which takes one database
+ configuration only is deprecated and will be rejected by a future release.
+
Next, the name of the database to hold the reservations must be set;
this is the name used when the lease database was created (see
::
- "Dhcp6": { "hosts-database": { "name": "database-name" , ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "name": "database-name" , ... } ], ... }
If the database is located on a different system than the DHCPv6 server,
the database host name must also be specified:
::
- "Dhcp6": { "hosts-database": { "host": remote-host-name, ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "host": remote-host-name, ... } ], ... }
Normally, the database is on the same machine as the DHCPv6 server.
In this case, set the value to the empty string:
::
- "Dhcp6": { "hosts-database": { "host" : "", ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "host" : "", ... } ], ... }
Should the database use a port different than the default, it may be
specified as well:
::
- "Dhcp6": { "hosts-database": { "port" : 12345, ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "port" : 12345, ... } ], ... }
The maximum number of times the server automatically attempts to
reconnect to the host database after connectivity has been lost may be
::
- "Dhcp6": { "hosts-database": { "max-reconnect-tries" : number-of-tries, ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "max-reconnect-tries" : number-of-tries, ... } ], ... }
If the server is unable to reconnect to the database after making the
maximum number of attempts, the server will exit. A value of 0 (the
::
- "Dhcp6": { "hosts-database": { "reconnect-wait-time" : number-of-milliseconds, ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "reconnect-wait-time" : number-of-milliseconds, ... } ], ... }
The default value for MySQL and PostgreSQL is 0, which disables automatic
recovery and causes the server to exit immediately upon detecting the
::
- "Dhcp6": { "hosts-database": { "on-fail" : "stop-retry-exit", ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "on-fail" : "stop-retry-exit", ... } ], ... }
The possible values are:
::
- "Dhcp6": { "hosts-database": { "retry-on-startup" : true, ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "retry-on-startup" : true, ... } ], ... }
During server startup, the inability to connect to any of the configured
backends is considered fatal only if ``retry-on-startup`` is set to ``false``
::
"Dhcp6": {
- "hosts-database": {
+ "hosts-databases": [ {
"user": "user-name",
"password": "1234",
...
- },
+ } ],
...
}
If there is no password to the account, set the password to the empty
string ``""``. (This is the default.)
-The multiple-storage extension uses a similar syntax; a configuration is
-placed into a ``hosts-databases`` list instead of into a ``hosts-database``
-entry, as in:
-
-::
-
- "Dhcp6": { "hosts-databases": [ { "type": "mysql", ... }, ... ], ... }
-
If the same host is configured both in-file and in-database, Kea does not issue a warning,
as it would if both were specified in the same data source.
Instead, the host configured in-file has priority over the one configured
::
- "Dhcp6": { "hosts-database": { "readonly": true, ... }, ... }
+ "Dhcp6": { "hosts-databases": [ { "readonly": true, ... } ], ... }
Setting this parameter to ``false`` configures the database backend to
operate in "read-write" mode, which is also the default configuration if
{
"result": 1,
- "text": "Unable to delete a host because there is no hosts-database configured."
+ "text": "Unable to delete a host because there is no hosts-databases configured."
}
The command accepts the ``operation-target`` argument. By default, it removes
"type": "memfile"
},
- // Note there is hosts-database defined. RADIUS and Host Cache libraries
+ // Note there is hosts-databases defined. RADIUS and Host Cache libraries
// will create them dynamically.
// RADIUS uses flex-id reservations, so restrict Kea to use flex-id only.
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
- "hosts-database": {
+ "hosts-databases": [ {
"type": "mysql",
"reconnect-wait-time": 3000, // expressed in ms
"max-reconnect-tries": 3,
"cert-file": "my-cert",
"key-file": "my-key",
"cipher-list": "AES"
- },
+ } ],
// Since Kea.2.7.4, the libdhcp_mysql.so hook library must be loaded in order to
// store host reservations in the MySQL Host Database Backend.
// Specify the host backend hook library location.
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
- // The database specification can go into one hosts-database entry for
- // backward compatibility or be listed in hosts-databases list.
+ // The database specification can be listed in hosts-databases list.
"hosts-databases": [
{
"type": "postgresql",
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
- "hosts-database": {
+ "hosts-databases": [ {
"type": "mysql",
"reconnect-wait-time": 3000, // expressed in ms
"max-reconnect-tries": 3,
"cert-file": "my-cert",
"key-file": "my-key",
"cipher-list": "AES"
- },
+ } ],
// Since Kea.2.7.4, the libdhcp_mysql.so hook library must be loaded in order to
// store host reservations in the MySQL Host Database Backend.
// Specify the host backend hook library location.
// reservations list, within the subnet (configuration file). If there are
// no reservations there, the server will try to retrieve reservations
// from this database.
- // The database specification can go into one hosts-database entry for
- // backward compatibility or be listed in hosts-databases list.
+ // The database specification can be listed in hosts-databases list.
"hosts-databases": [
{
"type": "postgresql",
the following host backend types are available: %1
This informational message lists all possible host backends that could
-be used in hosts-database[s].
+be used in hosts-databases.
HOSTS_BACKEND_DEREGISTER
========================
extern const isc::log::MessageID DHCP4_CLIENT_HOSTNAME_SCRUBBED_EMPTY = "DHCP4_CLIENT_HOSTNAME_SCRUBBED_EMPTY";
extern const isc::log::MessageID DHCP4_CLIENT_NAME_PROC_FAIL = "DHCP4_CLIENT_NAME_PROC_FAIL";
extern const isc::log::MessageID DHCP4_CONFIG_COMPLETE = "DHCP4_CONFIG_COMPLETE";
+extern const isc::log::MessageID DHCP4_CONFIG_HOSTS_DATABASE_DEPRECATED = "DHCP4_CONFIG_HOSTS_DATABASE_DEPRECATED";
extern const isc::log::MessageID DHCP4_CONFIG_LOAD_FAIL = "DHCP4_CONFIG_LOAD_FAIL";
extern const isc::log::MessageID DHCP4_CONFIG_PACKET_QUEUE = "DHCP4_CONFIG_PACKET_QUEUE";
extern const isc::log::MessageID DHCP4_CONFIG_RECEIVED = "DHCP4_CONFIG_RECEIVED";
"DHCP4_CLIENT_HOSTNAME_SCRUBBED_EMPTY", "%1: sanitizing client's Hostname option '%2' yielded an empty string",
"DHCP4_CLIENT_NAME_PROC_FAIL", "%1: failed to process the fqdn or hostname sent by a client: %2",
"DHCP4_CONFIG_COMPLETE", "DHCPv4 server has completed configuration: %1",
+ "DHCP4_CONFIG_HOSTS_DATABASE_DEPRECATED", "the \"host-database\" keyword will be deprecated",
"DHCP4_CONFIG_LOAD_FAIL", "configuration error using file: %1, reason: %2",
"DHCP4_CONFIG_PACKET_QUEUE", "DHCPv4 packet queue info after configuration: %1",
"DHCP4_CONFIG_RECEIVED", "received configuration %1",
extern const isc::log::MessageID DHCP4_CLIENT_HOSTNAME_SCRUBBED_EMPTY;
extern const isc::log::MessageID DHCP4_CLIENT_NAME_PROC_FAIL;
extern const isc::log::MessageID DHCP4_CONFIG_COMPLETE;
+extern const isc::log::MessageID DHCP4_CONFIG_HOSTS_DATABASE_DEPRECATED;
extern const isc::log::MessageID DHCP4_CONFIG_LOAD_FAIL;
extern const isc::log::MessageID DHCP4_CONFIG_PACKET_QUEUE;
extern const isc::log::MessageID DHCP4_CONFIG_RECEIVED;
configuration is committed by the administrator. Additional information
may be provided.
+% DHCP4_CONFIG_HOSTS_DATABASE_DEPRECATED the "host-database" keyword will be deprecated
+This warning message indicates the configuration still use
+the "hosts-database", a keyword which is deprecated and will
+be rejected by a future release,. Please use "hosts-databases" instead
+and put the database configuration into a list.
+
% DHCP4_CONFIG_LOAD_FAIL configuration error using file: %1, reason: %2
This error message indicates that the DHCPv4 configuration has failed.
If this is an initial configuration (during server's startup) the server
}
ConstElementPtr hosts_database = mutable_cfg->get("hosts-database");
+ ConstElementPtr hosts_databases = mutable_cfg->get("hosts-databases");
if (hosts_database) {
parameter_name = "hosts-database";
+ LOG_WARN(dhcp4_logger, DHCP4_CONFIG_HOSTS_DATABASE_DEPRECATED);
+ if (hosts_databases) {
+ isc_throw(DhcpConfigError, "can't use hosts-database and "
+ << "hosts-databases at the same time");
+ }
db::DbAccessParser parser;
std::string access_string;
parser.parse(access_string, hosts_database);
cfg_db_access->setHostDbAccessString(access_string);
}
- ConstElementPtr hosts_databases = mutable_cfg->get("hosts-databases");
if (hosts_databases) {
parameter_name = "hosts-databases";
CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
case LEASE_DATABASE:
return ("lease-database");
case HOSTS_DATABASE:
- return ("hosts-database");
+ return ("hosts-databases");
case DATABASE_ON_FAIL:
return ("database-on-fail");
case SSL_MODE:
/// Used while parsing Dhcp4/lease-database structures.
LEASE_DATABASE,
- /// Used while parsing Dhcp4/hosts-database[s] structures.
+ /// Used while parsing Dhcp4/hosts-databases structures.
HOSTS_DATABASE,
/// Used while parsing Dhcp4/*-database/on-fail.
"{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"},"
- "\"hosts-database\": {"
+ "\"hosts-database\": [ {"
" \"type\": \"mysql\","
" \"name\": \"keatest\","
" \"user\": \"keatest\","
" \"password\": \"keatest\""
- "},"
+ "} ],"
"\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, "
"\"subnet4\": [ { "
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED = "DHCP6_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP6_CLIENT_FQDN_SCRUBBED_EMPTY = "DHCP6_CLIENT_FQDN_SCRUBBED_EMPTY";
extern const isc::log::MessageID DHCP6_CONFIG_COMPLETE = "DHCP6_CONFIG_COMPLETE";
+extern const isc::log::MessageID DHCP6_CONFIG_HOSTS_DATABASE_DEPRECATED = "DHCP6_CONFIG_HOSTS_DATABASE_DEPRECATED";
extern const isc::log::MessageID DHCP6_CONFIG_LOAD_FAIL = "DHCP6_CONFIG_LOAD_FAIL";
extern const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE = "DHCP6_CONFIG_PACKET_QUEUE";
extern const isc::log::MessageID DHCP6_CONFIG_RECEIVED = "DHCP6_CONFIG_RECEIVED";
"DHCP6_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP6_CLIENT_FQDN_SCRUBBED_EMPTY", "%1: sanitizing client's FQDN option '%2' yielded an empty string",
"DHCP6_CONFIG_COMPLETE", "DHCPv6 server has completed configuration: %1",
+ "DHCP6_CONFIG_HOSTS_DATABASE_DEPRECATED", "the \"host-database\" keyword will be deprecated",
"DHCP6_CONFIG_LOAD_FAIL", "configuration error using file: %1, reason: %2",
"DHCP6_CONFIG_PACKET_QUEUE", "DHCPv6 packet queue info after configuration: %1",
"DHCP6_CONFIG_RECEIVED", "received configuration: %1",
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP6_CLIENT_FQDN_SCRUBBED_EMPTY;
extern const isc::log::MessageID DHCP6_CONFIG_COMPLETE;
+extern const isc::log::MessageID DHCP6_CONFIG_HOSTS_DATABASE_DEPRECATED;
extern const isc::log::MessageID DHCP6_CONFIG_LOAD_FAIL;
extern const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE;
extern const isc::log::MessageID DHCP6_CONFIG_RECEIVED;
configuration is committed by the administrator. Additional information
may be provided.
+% DHCP6_CONFIG_HOSTS_DATABASE_DEPRECATED the "host-database" keyword will be deprecated
+This warning message indicates the configuration still use
+the "hosts-database", a keyword which is deprecated and will
+be rejected by a future release,. Please use "hosts-databases" instead
+and put the database configuration into a list.
+
% DHCP6_CONFIG_LOAD_FAIL configuration error using file: %1, reason: %2
This error message indicates that the DHCPv6 configuration has failed.
If this is an initial configuration (during server's startup) the server
}
ConstElementPtr hosts_database = mutable_cfg->get("hosts-database");
+ ConstElementPtr hosts_databases = mutable_cfg->get("hosts-databases");
if (hosts_database) {
parameter_name = "hosts-database";
+ LOG_WARN(dhcp6_logger, DHCP6_CONFIG_HOSTS_DATABASE_DEPRECATED);
+ if (hosts_databases) {
+ isc_throw(DhcpConfigError, "can't use hosts-database and "
+ << "hosts-databases at the same time");
+ }
db::DbAccessParser parser;
std::string access_string;
parser.parse(access_string, hosts_database);
cfg_db_access->setHostDbAccessString(access_string);
}
- ConstElementPtr hosts_databases = mutable_cfg->get("hosts-databases");
if (hosts_databases) {
parameter_name = "hosts-databases";
CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
case LEASE_DATABASE:
return ("lease-database");
case HOSTS_DATABASE:
- return ("hosts-database");
+ return ("hosts-databases");
case DATABASE_ON_FAIL:
return ("database-on-fail");
case SSL_MODE:
/// Used while parsing Dhcp6/lease-database structures.
LEASE_DATABASE,
- /// Used while parsing Dhcp6/hosts-database[s] structures.
+ /// Used while parsing Dhcp6/hosts-databases structures.
HOSTS_DATABASE,
/// Used while parsing Dhcp6/*-database/on-fail.
"{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"},"
- "\"hosts-database\": {"
+ "\"hosts-database\": [ {"
" \"type\": \"mysql\","
" \"name\": \"keatest\","
" \"user\": \"keatest\","
" \"password\": \"keatest\""
- "},"
+ "} ],"
"\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, "
// small or you have few reservations, it's probably easier to keep them
// in the configuration file. If your network is large, it's usually better
// to use database for it. To enable it, uncomment the following:
- // "hosts-database": {
+ // "hosts-databases": [ {
// "type": "mysql",
// "name": "kea",
// "user": "kea",
// "password": "1234",
// "host": "localhost",
// "port": 3306
- // },
+ // } ],
// See Section 7.2.3 "Hosts storage" for details.
// Setup reclamation of the expired leases and leases affinity.
// small or you have few reservations, it's probably easier to keep them
// in the configuration file. If your network is large, it's usually better
// to use database for it. To enable it, uncomment the following:
- // "hosts-database": {
+ // "hosts-databases": [ {
// "type": "mysql",
// "name": "kea",
// "user": "kea",
// "password": "1234",
// "host": "localhost",
// "port": 3306
- // },
+ // } ],
// See Section 8.2.3 "Hosts storage" for details.
// Setup reclamation of the expired leases and leases affinity.
/// argument accordingly.
///
/// Note: for this operation to work while the operation-target was set to
- /// ALTERNATE_SOURCES, hosts-database must be specified in your
+ /// ALTERNATE_SOURCES, hosts-databases must be specified in your
/// configuration file (or from code point of view, alternate_source_
/// must be set in HostMgr).
///
}
// Checks that properly formed reservation-del(subnet-id, addr) will not work if
-// there is no hosts-database configured and the operation target is default.
+// there is no hosts-databases configured and the operation target is default.
TEST_F(HostCmdsTest, reservationDelNoHostsDatabaseDefaultSource) {
// Now send the command.
string cmd =
" }\n"
"}";
string exp_rsp = "Unable to delete a host because there is no "
- "hosts-database configured.";
+ "hosts-databases configured.";
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
}
// Checks that properly formed reservation-del(subnet-id, addr) will work if
-// there is no hosts-database configured but the operation target is memory
+// there is no hosts-databases configured but the operation target is memory
// source.
TEST_F(HostCmdsTest, reservationDelNoHostsDatabaseMemorySource) {
// Now send the command.
/// @brief Parse Database Parameters
///
/// This class is the parser for the database configuration. This is a
-/// map under the top-level "lease-database", "hosts-database" and
-/// "config-database" elements, and comprises a map of strings.
+/// map under the top-level "lease-database", "hosts-databases" and
+/// "config-databases" elements, and comprises a map of strings.
class DbAccessParser: public isc::data::SimpleParser {
public:
/// @brief Constructor
// Don't throw if all targets were selected.
if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
isc_throw(NoHostDataSourceManager, "Unable to add new host because there is "
- "no hosts-database configured.");
+ "no hosts-databases configured.");
}
// Don't throw if all targets were selected.
if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is "
- "no hosts-database configured.");
+ "no hosts-databases configured.");
}
for (auto const& source : alternate_sources_) {
// Don't throw if all targets were selected.
if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is "
- "no hosts-database configured.");
+ "no hosts-databases configured.");
}
for (auto const& source : alternate_sources_) {
// Don't throw if all targets were selected.
if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is "
- "no hosts-database configured.");
+ "no hosts-databases configured.");
}
for (auto const& source : alternate_sources_) {
// Don't throw if all targets were selected.
if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) {
isc_throw(NoHostDataSourceManager,
- "Unable to update existing host because there is no hosts-database configured.");
+ "Unable to update existing host because there is no hosts-databases configured.");
}
for (HostDataSourcePtr const& source : alternate_sources_) {
% HOSTS_BACKENDS_REGISTERED the following host backend types are available: %1
This informational message lists all possible host backends that could
-be used in hosts-database[s].
+be used in hosts-databases.
% HOSTS_BACKEND_DEREGISTER deregistered host backend type: %1
Logged at debug log level 40.
HostPtr host(new Host(hwaddrs_[0]->toText(false), "hw-address",
SubnetID(1), SUBNET_ID_UNUSED, IOAddress("192.0.2.5")));
EXPECT_THROW_MSG(HostMgr::instance().add(host), NoHostDataSourceManager,
- "Unable to add new host because there is no hosts-database configured.");
+ "Unable to add new host because there is no hosts-databases configured.");
EXPECT_THROW_MSG(HostMgr::instance().update(host), NoHostDataSourceManager,
- "Unable to update existing host because there is no hosts-database "
+ "Unable to update existing host because there is no hosts-databases "
"configured.");
}
}
}
],
- "hosts-database": {
+ "hosts-databases": [ {
"password": "sensitive",
"type": "mysql",
"user": "keatest"
- },
+ } ],
"lease-database": {
"password": "sensitive",
"type": "mysql",