zeek/scripts/base/frameworks/supervisor/api.zeek
Jon Siwek 773b39e52e Finish implementing supervisor infrastructure
The process hierarchy and all supervisor control commands are now
working (e.g. status, create, destroy, restart), but nodes are
not currently spawned with the desired configuration parameters so
they don't yet operate as real cluster nodes (e.g. worker, logger,
manager, proxy).
2019-10-18 17:57:20 -07:00

36 lines
1.1 KiB
Text

##! The Zeek process supervision API.
# TODO: add proper docs
module Supervisor;
export {
type Node: record {
# TODO: add proper config fields
name: string;
pid: count &optional;
};
type Status: record {
# TODO: add more status fields ?
nodes: table[string] of Node;
};
global status: function(nodes: string &default="all"): Status;
global create: function(node: Node): string;
global destroy: function(nodes: string): bool;
global restart: function(nodes: string &default="all"): bool;
global Supervisor::stop_request: event();
global Supervisor::status_request: event(id: count, nodes: string);
global Supervisor::status_response: event(id: count, result: Status);
global Supervisor::create_request: event(id: count, node: Node);
global Supervisor::create_response: event(id: count, result: string);
global Supervisor::destroy_request: event(id: count, nodes: string);
global Supervisor::destroy_response: event(id: count, result: bool);
global Supervisor::restart_request: event(id: count, nodes: string);
global Supervisor::restart_response: event(id: count, result: bool);
}