policy/frameworks/cluster/controller/api.zeek

ClusterController::API

The event API of cluster controllers. Most endpoints consist of event pairs, where the controller answers a zeek-client request event with a corresponding response event. Such event pairs share the same name prefix and end in “_request” and “_response”, respectively.

Namespace

ClusterController::API

Imports

policy/frameworks/cluster/controller/types.zeek

Summary

Constants

ClusterController::API::version: count

A simple versioning scheme, used to track basic compatibility of controller, agents, and zeek-client.

Events

ClusterController::API::get_instances_request: event

zeek-client sends this event to request a list of the currently peered agents/instances.

ClusterController::API::get_instances_response: event

Response to a get_instances_request event.

ClusterController::API::notify_agents_ready: event

The controller triggers this event when the operational cluster instances align with the ones desired by the cluster configuration.

ClusterController::API::set_configuration_request: event

zeek-client sends this event to establish a new cluster configuration, including the full cluster topology.

ClusterController::API::set_configuration_response: event

Response to a set_configuration_request event.

ClusterController::API::test_timeout_request: event

This event causes no further action (other than getting logged) if with_state is F.

ClusterController::API::test_timeout_response: event

Response to a test_timeout_request event.

Detailed Interface

Constants

ClusterController::API::version
Type

count

Default

1

A simple versioning scheme, used to track basic compatibility of controller, agents, and zeek-client.

Events

ClusterController::API::get_instances_request
Type

event (reqid: string)

zeek-client sends this event to request a list of the currently peered agents/instances.

Reqid

a request identifier string, echoed in the response event.

ClusterController::API::get_instances_response
Type

event (reqid: string, result: ClusterController::Types::Result)

Response to a get_instances_request event. The controller sends this back to the client.

Reqid

the request identifier used in the request event.

Result

the result record. Its data member is a ClusterController::Types::Instance record.

ClusterController::API::notify_agents_ready
Type

event (instances: set [string])

The controller triggers this event when the operational cluster instances align with the ones desired by the cluster configuration. It’s essentially a cluster management readiness event. This event is currently only used by the controller and not published to other topics.

Instances

the set of instance names now ready.

ClusterController::API::set_configuration_request
Type

event (reqid: string, config: ClusterController::Types::Configuration)

zeek-client sends this event to establish a new cluster configuration, including the full cluster topology. The controller processes the update 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.

Reqid

a request identifier string, echoed in the response event.

Config

a ClusterController::Types::Configuration record specifying the cluster configuration.

ClusterController::API::set_configuration_response
Type

event (reqid: string, result: ClusterController::Types::ResultVec)

Response to a set_configuration_request event. The controller sends this back to the client.

Reqid

the request identifier used in the request event.

Result

a vector of ClusterController::Types::Result records. Each member captures one agent’s response.

ClusterController::API::test_timeout_request
Type

event (reqid: string, with_state: bool)

This event causes no further action (other than getting logged) if with_state is F. When T, the controller establishes request state, and the controller only ever sends the response event when this state times out.

Reqid

a request identifier string, echoed in the response event when with_state is T.

With_state

flag indicating whether the controller should keep (and time out) request state for this request.

ClusterController::API::test_timeout_response
Type

event (reqid: string, result: ClusterController::Types::Result)

Response to a test_timeout_request event. The controller sends this back to the client if the original request had the with_state flag.

Reqid

the request identifier used in the request event.