Merge branch 'topic/christian/management-get-config'

* topic/christian/management-get-config:
  Management framework: add get_configuration_request/response transaction
This commit is contained in:
Christian Kreibich 2022-05-05 18:06:55 -07:00
commit 7198c847e8
7 changed files with 55 additions and 4 deletions

View file

@ -1,3 +1,9 @@
5.0.0-dev.347 | 2022-05-05 18:09:44 -0700
* Management framework: add get_configuration_request/response transaction (Christian Kreibich, Corelight)
* Update zeek-archiver submodule (Christian Kreibich, Corelight)
5.0.0-dev.344 | 2022-05-04 11:57:50 -0700 5.0.0-dev.344 | 2022-05-04 11:57:50 -0700
* fix for coverage reporting for functions that use "when" statements (Vern Paxson, Corelight) * fix for coverage reporting for functions that use "when" statements (Vern Paxson, Corelight)

View file

@ -1 +1 @@
5.0.0-dev.344 5.0.0-dev.347

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

@ -1 +1 @@
Subproject commit a08d9978ac6ff6481ad1e6b18f0376568c08f8c1 Subproject commit 175a5e9324a1bd28a860f35f8e83c06625376bd5

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 ea9418bd21803c7cc6e890841052fdbc6649838e