mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Management framework: trivial changes and comment-only rewording
This commit is contained in:
parent
4deacefa4c
commit
3ac5fdfc59
3 changed files with 19 additions and 19 deletions
|
@ -1,7 +1,7 @@
|
||||||
##! The event API of cluster controllers. Most endpoints consist of event pairs,
|
##! The event API of cluster controllers. Most endpoints consist of event pairs,
|
||||||
##! where the controller answers a zeek-client request event with a
|
##! where the controller answers the client's request event with a corresponding
|
||||||
##! corresponding response event. Such event pairs share the same name prefix
|
##! response event. Such event pairs share the same name prefix and end in
|
||||||
##! and end in "_request" and "_response", respectively.
|
##! "_request" and "_response", respectively.
|
||||||
|
|
||||||
@load policy/frameworks/management/types
|
@load policy/frameworks/management/types
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ module Management::Controller::API;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
## A simple versioning scheme, used to track basic compatibility of
|
## A simple versioning scheme, used to track basic compatibility of
|
||||||
## controller, agents, and zeek-client.
|
## controller, agents, and the client.
|
||||||
const version = 1;
|
const version = 1;
|
||||||
|
|
||||||
|
|
||||||
## zeek-client sends this event to request a list of the currently
|
## The client sends this event to request a list of the currently
|
||||||
## peered agents/instances.
|
## peered agents/instances.
|
||||||
##
|
##
|
||||||
## reqid: a request identifier string, echoed in the response event.
|
## reqid: a request identifier string, echoed in the response event.
|
||||||
|
@ -32,7 +32,7 @@ export {
|
||||||
result: Management::Result);
|
result: Management::Result);
|
||||||
|
|
||||||
|
|
||||||
## zeek-client sends this event to establish a new cluster configuration,
|
## The client sends this event to establish a new cluster configuration,
|
||||||
## including the full cluster topology. The controller processes the update
|
## including the full cluster topology. The controller processes the update
|
||||||
## and relays it to the agents. Once each has responded (or a timeout occurs)
|
## and relays it to the agents. Once each has responded (or a timeout occurs)
|
||||||
## the controller sends a corresponding response event back to the client.
|
## the controller sends a corresponding response event back to the client.
|
||||||
|
@ -57,7 +57,7 @@ export {
|
||||||
result: Management::ResultVec);
|
result: Management::ResultVec);
|
||||||
|
|
||||||
|
|
||||||
## zeek-client sends this event to retrieve the currently deployed
|
## The client sends this event to retrieve the currently deployed
|
||||||
## cluster configuration.
|
## cluster configuration.
|
||||||
##
|
##
|
||||||
## reqid: a request identifier string, echoed in the response event.
|
## reqid: a request identifier string, echoed in the response event.
|
||||||
|
@ -78,7 +78,7 @@ export {
|
||||||
result: Management::Result);
|
result: Management::Result);
|
||||||
|
|
||||||
|
|
||||||
## zeek-client sends this event to request a list of
|
## The 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
|
||||||
## instances.
|
## instances.
|
||||||
|
@ -102,7 +102,7 @@ export {
|
||||||
result: Management::ResultVec);
|
result: Management::ResultVec);
|
||||||
|
|
||||||
|
|
||||||
## zeek-client sends this event to retrieve the current value of a
|
## The client sends this event to retrieve the current value of a
|
||||||
## variable in Zeek's global namespace, referenced by the given
|
## variable in Zeek's global namespace, referenced by the given
|
||||||
## identifier (i.e., variable name). The controller asks all agents
|
## identifier (i.e., variable name). The controller asks all agents
|
||||||
## to retrieve this value from each cluster node, accumulates the
|
## to retrieve this value from each cluster node, accumulates the
|
||||||
|
|
|
@ -91,7 +91,7 @@ global drop_instance: function(inst: Management::Instance);
|
||||||
|
|
||||||
# Helpers to simplify handling of config records.
|
# Helpers to simplify handling of config records.
|
||||||
global null_config: function(): Management::Configuration;
|
global null_config: function(): Management::Configuration;
|
||||||
global is_null_config: function(config: Management::Configuration): bool;
|
global config_is_null: function(config: Management::Configuration): bool;
|
||||||
|
|
||||||
# Returns list of names of nodes in the given configuration that require a
|
# Returns list of names of nodes in the given configuration that require a
|
||||||
# listening port. Returns empty list if the config has no such nodes.
|
# listening port. Returns empty list if the config has no such nodes.
|
||||||
|
@ -505,7 +505,7 @@ function find_endpoint(id: string): Broker::EndpointInfo
|
||||||
return Broker::EndpointInfo($id="");
|
return Broker::EndpointInfo($id="");
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_null_config(config: Management::Configuration): bool
|
function config_is_null(config: Management::Configuration): bool
|
||||||
{
|
{
|
||||||
return config$id == "";
|
return config$id == "";
|
||||||
}
|
}
|
||||||
|
@ -654,7 +654,6 @@ event Management::Agent::API::agent_welcome_response(reqid: string, result: Mana
|
||||||
|
|
||||||
# An agent we've been waiting to hear back from is ready for cluster
|
# An agent we've been waiting to hear back from is ready for cluster
|
||||||
# work. Double-check we still want it, otherwise drop it.
|
# work. Double-check we still want it, otherwise drop it.
|
||||||
|
|
||||||
if ( ! result$success || result$instance !in g_instances )
|
if ( ! result$success || result$instance !in g_instances )
|
||||||
{
|
{
|
||||||
Management::Log::info(fmt(
|
Management::Log::info(fmt(
|
||||||
|
@ -897,7 +896,7 @@ event Management::Controller::API::get_configuration_request(reqid: string)
|
||||||
|
|
||||||
local res = Management::Result($reqid=reqid);
|
local res = Management::Result($reqid=reqid);
|
||||||
|
|
||||||
if ( is_null_config(g_config_current) )
|
if ( config_is_null(g_config_current) )
|
||||||
{
|
{
|
||||||
# We don't have a live configuration yet.
|
# We don't have a live configuration yet.
|
||||||
res$success = F;
|
res$success = F;
|
||||||
|
@ -1247,11 +1246,12 @@ event zeek_init()
|
||||||
# set_configuration request.
|
# set_configuration request.
|
||||||
g_config_current = null_config();
|
g_config_current = null_config();
|
||||||
|
|
||||||
# The controller always listens -- it needs to be able to respond to the
|
# The controller always listens: it needs to be able to respond to
|
||||||
# Zeek client. This port is also used by the agents if they connect to
|
# clients connecting to it, as well as agents if they connect to the
|
||||||
# the client. The client doesn't automatically establish or accept
|
# controller. The controller does not automatically connect to any
|
||||||
# connectivity to agents: agents are defined and communicated with as
|
# agents; instances with listening agents are conveyed to the controller
|
||||||
# defined via configurations defined by the client.
|
# via configurations uploaded by a client, with connections established
|
||||||
|
# upon deployment.
|
||||||
|
|
||||||
local cni = Management::Controller::network_info();
|
local cni = Management::Controller::network_info();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue