2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 13:07:50 +00:00

[904-add-ability-to-force-a-cb-update-remotely] Used "on demand" instead of pull at the exception of the command name

This commit is contained in:
Francis Dupont 2019-10-27 19:44:24 +01:00
parent 0af2c4de90
commit 32e422a985
9 changed files with 25 additions and 21 deletions

View File

@ -19,7 +19,7 @@
"resp-syntax": [
"{",
" \"result\": 0,",
" \"text\": \"Server update successful.\"",
" \"text\": \"On demand configuration update successful.\"",
"}"
],

View File

@ -564,12 +564,14 @@ ControlledDhcpv4Srv::commandConfigBackendPullHandler(const std::string&,
auto mode = CBControlDHCPv4::FetchMode::FETCH_UPDATE;
server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
} catch (const std::exception& ex) {
LOG_ERROR(dhcp4_logger, DHCP4_CB_PULL_FETCH_UPDATES_FAIL)
LOG_ERROR(dhcp4_logger, DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL)
.arg(ex.what());
return (createAnswer(CONTROL_RESULT_ERROR,
"Server update failed: " + string(ex.what())));
"On demand configuration update failed: " +
string(ex.what())));
}
return (createAnswer(CONTROL_RESULT_SUCCESS, "Server update successful."));
return (createAnswer(CONTROL_RESULT_SUCCESS,
"On demand configuration update successful."));
}
ConstElementPtr

View File

@ -1,4 +1,4 @@
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Sun Oct 27 2019 19:40
#include <cstddef>
#include <log/message_types.h>
@ -13,9 +13,9 @@ extern const isc::log::MessageID DHCP4_BUFFER_RECEIVED = "DHCP4_BUFFER_RECEIVED"
extern const isc::log::MessageID DHCP4_BUFFER_RECEIVE_FAIL = "DHCP4_BUFFER_RECEIVE_FAIL";
extern const isc::log::MessageID DHCP4_BUFFER_UNPACK = "DHCP4_BUFFER_UNPACK";
extern const isc::log::MessageID DHCP4_BUFFER_WAIT_SIGNAL = "DHCP4_BUFFER_WAIT_SIGNAL";
extern const isc::log::MessageID DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL = "DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
extern const isc::log::MessageID DHCP4_CB_PULL_FETCH_UPDATES_FAIL = "DHCP4_CB_PULL_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED = "DHCP4_CLASS_ASSIGNED";
extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED = "DHCP4_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED = "DHCP4_CLASS_UNDEFINED";
@ -151,9 +151,9 @@ const char* values[] = {
"DHCP4_BUFFER_RECEIVE_FAIL", "error on attempt to receive packet: %1",
"DHCP4_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
"DHCP4_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
"DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
"DHCP4_CB_PULL_FETCH_UPDATES_FAIL", "error on pull attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP4_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
"DHCP4_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP4_CLASS_UNDEFINED", "required class %1 has no definition",

View File

@ -1,4 +1,4 @@
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Sun Oct 27 2019 19:40
#ifndef DHCP4_MESSAGES_H
#define DHCP4_MESSAGES_H
@ -14,9 +14,9 @@ extern const isc::log::MessageID DHCP4_BUFFER_RECEIVED;
extern const isc::log::MessageID DHCP4_BUFFER_RECEIVE_FAIL;
extern const isc::log::MessageID DHCP4_BUFFER_UNPACK;
extern const isc::log::MessageID DHCP4_BUFFER_WAIT_SIGNAL;
extern const isc::log::MessageID DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
extern const isc::log::MessageID DHCP4_CB_PULL_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED;
extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED;

View File

@ -60,9 +60,9 @@ The server will continue to operate but won't make any further attempts
to fetch configuration updates. The administrator must fix the configuration
in the database and reload (or restart) the server.
% DHCP4_CB_PULL_FETCH_UPDATES_FAIL error on pull attempt to fetch configuration updates from the configuration backend(s): %1
% DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL error on demand attempt to fetch configuration updates from the configuration backend(s): %1
This error message is issued when the server attempted to fetch
configuration updates from the database and this pull attempt failed.
configuration updates from the database and this on demand attempt failed.
The sole argument which is returned to the config-backend-pull command
caller too contains the reason for failure.

View File

@ -564,12 +564,14 @@ ControlledDhcpv6Srv::commandConfigBackendPullHandler(const std::string&,
auto mode = CBControlDHCPv6::FetchMode::FETCH_UPDATE;
server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
} catch (const std::exception& ex) {
LOG_ERROR(dhcp6_logger, DHCP6_CB_PULL_FETCH_UPDATES_FAIL)
LOG_ERROR(dhcp6_logger, DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL)
.arg(ex.what());
return (createAnswer(CONTROL_RESULT_ERROR,
"Server update failed: " + string(ex.what())));
"On demand configuration update failed: " +
string(ex.what())));
}
return (createAnswer(CONTROL_RESULT_SUCCESS, "Server update successful."));
return (createAnswer(CONTROL_RESULT_SUCCESS,
"On demand configuration update successful."));
}
isc::data::ConstElementPtr

View File

@ -1,4 +1,4 @@
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Sun Oct 27 2019 19:41
#include <cstddef>
#include <log/message_types.h>
@ -14,9 +14,9 @@ extern const isc::log::MessageID DHCP6_ALREADY_RUNNING = "DHCP6_ALREADY_RUNNING"
extern const isc::log::MessageID DHCP6_BUFFER_RECEIVED = "DHCP6_BUFFER_RECEIVED";
extern const isc::log::MessageID DHCP6_BUFFER_UNPACK = "DHCP6_BUFFER_UNPACK";
extern const isc::log::MessageID DHCP6_BUFFER_WAIT_SIGNAL = "DHCP6_BUFFER_WAIT_SIGNAL";
extern const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL = "DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
extern const isc::log::MessageID DHCP6_CB_PULL_FETCH_UPDATES_FAIL = "DHCP6_CB_PULL_FETCH_UPDATES_FAIL";
extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED = "DHCP6_CLASS_ASSIGNED";
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED = "DHCP6_CLASS_UNCONFIGURED";
extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED = "DHCP6_CLASS_UNDEFINED";
@ -158,9 +158,9 @@ const char* values[] = {
"DHCP6_BUFFER_RECEIVED", "received buffer from %1:%2 to %3:%4 over interface %5",
"DHCP6_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
"DHCP6_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
"DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
"DHCP6_CB_PULL_FETCH_UPDATES_FAIL", "error on pull attempt to fetch configuration updates from the configuration backend(s): %1",
"DHCP6_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
"DHCP6_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
"DHCP6_CLASS_UNDEFINED", "required class %1 has no definition",

View File

@ -1,4 +1,4 @@
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 22:42
// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Sun Oct 27 2019 19:41
#ifndef DHCP6_MESSAGES_H
#define DHCP6_MESSAGES_H
@ -15,9 +15,9 @@ extern const isc::log::MessageID DHCP6_ALREADY_RUNNING;
extern const isc::log::MessageID DHCP6_BUFFER_RECEIVED;
extern const isc::log::MessageID DHCP6_BUFFER_UNPACK;
extern const isc::log::MessageID DHCP6_BUFFER_WAIT_SIGNAL;
extern const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
extern const isc::log::MessageID DHCP6_CB_PULL_FETCH_UPDATES_FAIL;
extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED;
extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED;
extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED;

View File

@ -67,9 +67,9 @@ The server will continue to operate but won't make any further attempts
to fetch configuration updates. The administrator must fix the configuration
in the database and reload (or restart) the server.
% DHCP6_CB_PULL_FETCH_UPDATES_FAIL error on pull attempt to fetch configuration updates from the configuration backend(s): %1
% DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL error on demand attempt to fetch configuration updates from the configuration backend(s): %1
This error message is issued when the server attempted to fetch
configuration updates from the database and this pull attempt failed.
configuration updates from the database and this on demand attempt failed.
The sole argument which is returned to the config-backend-pull command
caller too contains the reason for failure.