diff --git a/auxil/broker b/auxil/broker index 9f2f16c1da..18b070fe1e 160000 --- a/auxil/broker +++ b/auxil/broker @@ -1 +1 @@ -Subproject commit 9f2f16c1da94b03790bc8b9f69bc2688e97b781f +Subproject commit 18b070fe1e8f9e141da2a8393779abc5e4fca886 diff --git a/auxil/zeek-client b/auxil/zeek-client index a08d9978ac..b443dd4e09 160000 --- a/auxil/zeek-client +++ b/auxil/zeek-client @@ -1 +1 @@ -Subproject commit a08d9978ac6ff6481ad1e6b18f0376568c08f8c1 +Subproject commit b443dd4e098ea4d70771940515cf7833de29b325 diff --git a/scripts/policy/frameworks/management/controller/api.zeek b/scripts/policy/frameworks/management/controller/api.zeek index ad9b22cc26..d3822f3d02 100644 --- a/scripts/policy/frameworks/management/controller/api.zeek +++ b/scripts/policy/frameworks/management/controller/api.zeek @@ -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 diff --git a/scripts/policy/frameworks/management/controller/main.zeek b/scripts/policy/frameworks/management/controller/main.zeek index 72ecf2be30..728ca36518 100644 --- a/scripts/policy/frameworks/management/controller/main.zeek +++ b/scripts/policy/frameworks/management/controller/main.zeek @@ -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)); diff --git a/testing/external/commit-hash.zeek-testing-cluster b/testing/external/commit-hash.zeek-testing-cluster index f8de34839f..ca20c34317 100644 --- a/testing/external/commit-hash.zeek-testing-cluster +++ b/testing/external/commit-hash.zeek-testing-cluster @@ -1 +1 @@ -1b515f3f60abed5c505a970cae380560ce6304c1 +e992af6c5b7b6416cd34c43f1d003227f303a72e