mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
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:
parent
aa5a5b2136
commit
001de561fc
5 changed files with 48 additions and 3 deletions
|
@ -57,6 +57,27 @@ export {
|
|||
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:see:`Management::NodeStatus` records that capture
|
||||
## the status of Supervisor-managed nodes running on the cluster's
|
||||
|
|
|
@ -495,6 +495,30 @@ event Management::Controller::API::set_configuration_request(reqid: string, conf
|
|||
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)
|
||||
{
|
||||
Management::Log::info(fmt("rx Management::Controller::API::set_instances_request %s", reqid));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue