policy/frameworks/management/controller/main.zeek

Management::Controller::Runtime

This is the main “runtime” of the Management framework’s controller. Zeek does not load this directly; rather, the controller’s bootstrapping module (in ./boot.zeek) specifies it as the script to run in the node newly created by the supervisor.

Namespace

Management::Controller::Runtime

Imports

base/frameworks/broker, policy/frameworks/management, policy/frameworks/management/agent/api.zeek, policy/frameworks/management/agent/config.zeek, policy/frameworks/management/controller/api.zeek, policy/frameworks/management/controller/config.zeek

Detailed Interface

Types

Management::Controller::Runtime::ConfigState
Type

enum

Management::Controller::Runtime::STAGED

As provided by the client.

Management::Controller::Runtime::READY

Necessary updates made, e.g. ports filled in.

Management::Controller::Runtime::DEPLOYED

Sent off to the agents for deployment.

A cluster configuration uploaded by the client goes through multiple states on its way to deployment.

Management::Controller::Runtime::DeployState
Type

record

config: Management::Configuration

The cluster configuration the controller is deploying.

is_internal: bool &default = F &optional

Whether this is a controller-internal deployment, or triggered via a request by a remote peer/client.

requests: set [string] &default = {  } &optional

Request state for every controller/agent transaction.

Request state specific to Management::Controller::API::deploy_request and Management::Controller::API::deploy_response.

Management::Controller::Runtime::GetNodesState
Type

record

requests: set [string] &default = {  } &optional

Request state for every controller/agent transaction.

Request state specific to Management::Controller::API::get_nodes_request and Management::Controller::API::get_nodes_response.

Management::Controller::Runtime::NodeDispatchState
Type

record

action: vector of string

The dispatched action. The first string is a command, any remaining strings its arguments.

requests: set [string] &default = {  } &optional

Request state for every controller/agent transaction. The set of strings tracks the node names from which we still expect responses, before we can respond back to the client.

Request state for node dispatch requests, to track the requested action and received responses. Node dispatches are requests to execute pre-implemented actions on every node in the cluster, and report their outcomes. See Management::Agent::API::node_dispatch_request and Management::Agent::API::node_dispatch_response for the agent/controller interaction, and Management::Controller::API::get_id_value_request and Management::Controller::API::get_id_value_response for an example of a specific API the controller generalizes into a dispatch.

Management::Controller::Runtime::RestartState
Type

record

requests: set [string] &default = {  } &optional

Request state for every controller/agent transaction.

Request state specific to Management::Controller::API::restart_request and Management::Controller::API::restart_response.

Management::Controller::Runtime::TestState
Type

record

Dummy state for internal state-keeping test cases.