Management framework: add get_configuration_request/response transaction

Includes submodule bumps for Broker (to pull in better handling of data
structures that are difficult to unserialize in Python), zeek-client (for the
get-config command), and a commit hash update for the external testsuite.
This commit is contained in:
Christian Kreibich 2022-04-28 16:37:31 -07:00
parent aa5a5b2136
commit 001de561fc
5 changed files with 48 additions and 3 deletions

@ -1 +1 @@
Subproject commit 9f2f16c1da94b03790bc8b9f69bc2688e97b781f Subproject commit 18b070fe1e8f9e141da2a8393779abc5e4fca886

@ -1 +1 @@
Subproject commit a08d9978ac6ff6481ad1e6b18f0376568c08f8c1 Subproject commit b443dd4e098ea4d70771940515cf7833de29b325

View file

@ -57,6 +57,27 @@ export {
result: Management::ResultVec); result: Management::ResultVec);
## zeek-client sends this event to retrieve the currently deployed
## cluster configuration.
##
## reqid: a request identifier string, echoed in the response event.
##
global get_configuration_request: event(reqid: string);
## Response to a get_configuration_request event. The controller sends
## this back to the client.
##
## reqid: the request identifier used in the request event.
##
## result: a :zeek:see:`Management::Result` record with a successful
## :zeek:see:`Management::Configuration` in the data member, if
## a configuration is currently deployed. Otherwise, a Result
## record in error state, with no data value assigned.
##
global get_configuration_response: event(reqid: string,
result: Management::Result);
## zeek-client sends this event to request a list of ## zeek-client sends this event to request a list of
## :zeek:see:`Management::NodeStatus` records that capture ## :zeek:see:`Management::NodeStatus` records that capture
## the status of Supervisor-managed nodes running on the cluster's ## the status of Supervisor-managed nodes running on the cluster's

View file

@ -495,6 +495,30 @@ event Management::Controller::API::set_configuration_request(reqid: string, conf
check_instances_ready(); check_instances_ready();
} }
event Management::Controller::API::get_configuration_request(reqid: string)
{
Management::Log::info(fmt("rx Management::Controller::API::get_configuration_request %s", reqid));
local res = Management::Result($reqid=reqid);
if ( is_null_config(g_config_current) )
{
# We don't have a live configuration yet.
res$success = F;
res$error = "no configuration deployed";
}
else
{
res$data = g_config_current;
}
Management::Log::info(fmt(
"tx Management::Controller::API::get_configuration_response %s",
Management::result_to_string(res)));
Broker::publish(Management::Controller::topic,
Management::Controller::API::get_configuration_response, reqid, res);
}
event Management::Controller::API::get_instances_request(reqid: string) event Management::Controller::API::get_instances_request(reqid: string)
{ {
Management::Log::info(fmt("rx Management::Controller::API::set_instances_request %s", reqid)); Management::Log::info(fmt("rx Management::Controller::API::set_instances_request %s", reqid));

View file

@ -1 +1 @@
1b515f3f60abed5c505a970cae380560ce6304c1 e992af6c5b7b6416cd34c43f1d003227f303a72e