Updates to the cluster controller scripts to fix the docs build

Mostly trivial changes, except for one aspect: if a module exports a record type
and that record bears Zeekygen comments, then redefs that add to the record in
another module cannot be private to that module. Zeekygen will complain with
"unknown target" errors, even when such redefs have Zeekygen comments. So this
commits also adds two export-blocks that aren't technically required at this point.
This commit is contained in:
Christian Kreibich 2022-02-09 12:26:42 -08:00
parent 41abf8f422
commit 3e0a86e3b3
5 changed files with 40 additions and 18 deletions

View file

@ -56,7 +56,7 @@ export {
## reqid: the request identifier used in the request event. ## reqid: the request identifier used in the request event.
## ##
## result: a :zeek:see:`ClusterController::Types::Result` record. Its data ## result: a :zeek:see:`ClusterController::Types::Result` record. Its data
## member is a vector of :zeek:see:`ClusterController::Types::NodeState` ## member is a vector of :zeek:see:`ClusterController::Types::NodeStatus`
## records, covering the nodes at this instance. The result may also ## records, covering the nodes at this instance. The result may also
## indicate failure, with error messages indicating what went wrong. ## indicate failure, with error messages indicating what went wrong.
## ##

View file

@ -13,10 +13,15 @@
module ClusterAgent::Runtime; module ClusterAgent::Runtime;
# Request state specific to supervisor interactions # This export is mainly to appease Zeekygen's need to understand redefs of the
type SupervisorState: record { # Request record below. Without it, it fails to establish link targets for the
node: string; # tucked-on types.
}; export {
## Request state specific to the agent's Supervisor interactions.
type SupervisorState: record {
node: string; ##< Name of the node the Supervisor is acting on.
};
}
redef record ClusterController::Request::Request += { redef record ClusterController::Request::Request += {
supervisor_state: SupervisorState &optional; supervisor_state: SupervisorState &optional;

View file

@ -73,7 +73,7 @@ export {
## ##
## result: a :zeek:type`vector` of :zeek:see:`ClusterController::Types::Result` ## result: a :zeek:type`vector` of :zeek:see:`ClusterController::Types::Result`
## records. Each record covers one cluster instance. Each record's data ## records. Each record covers one cluster instance. Each record's data
## member is a vector of :zeek:see:`ClusterController::Types::NodeState` ## member is a vector of :zeek:see:`ClusterController::Types::NodeStatus`
## records, covering the nodes at that instance. Results may also indicate ## records, covering the nodes at that instance. Results may also indicate
## failure, with error messages indicating what went wrong. ## failure, with error messages indicating what went wrong.
global get_nodes_response: event(reqid: string, global get_nodes_response: event(reqid: string,

View file

@ -15,19 +15,31 @@
module ClusterController::Runtime; module ClusterController::Runtime;
# Request state specific to the set_configuration request/response events # This export is mainly to appease Zeekygen's need to understand redefs of the
type SetConfigurationState: record { # Request record below. Without it, it fails to establish link targets for the
# tucked-on types.
export {
## Request state specific to
## :zeek:see:`ClusterController::API::set_configuration_request` and
## :zeek:see:`ClusterController::API::set_configuration_response`.
type SetConfigurationState: record {
## The cluster configuration established with this request
config: ClusterController::Types::Configuration; config: ClusterController::Types::Configuration;
## Request state for every controller/agent transaction.
requests: set[string] &default=set(); requests: set[string] &default=set();
}; };
# Request state specific to the get_nodes request/response events ## Request state specific to
type GetNodesState: record { ## :zeek:see:`ClusterController::API::get_nodes_request` and
## :zeek:see:`ClusterController::API::get_nodes_response`.
type GetNodesState: record {
## Request state for every controller/agent transaction.
requests: set[string] &default=set(); requests: set[string] &default=set();
}; };
# Dummy state for testing events. ## Dummy state for internal state-keeping test cases.
type TestState: record { }; type TestState: record { };
}
redef record ClusterController::Request::Request += { redef record ClusterController::Request::Request += {
set_configuration_state: SetConfigurationState &optional; set_configuration_state: SetConfigurationState &optional;

View file

@ -8,7 +8,12 @@
module ClusterController::Request; module ClusterController::Request;
export { export {
## Request records track each request's state. ## Request records track state associated with a request/response event
## pair. Calls to
## :zeek:see:`ClusterController::Request::create` establish such state
## when an entity sends off a request event, while
## :zeek:see:`ClusterController::Request::finish` clears the state when
## a corresponding response event comes in, or the state times out.
type Request: record { type Request: record {
## Each request has a hopfully unique ID provided by the requester. ## Each request has a hopfully unique ID provided by the requester.
id: string; id: string;