policy/frameworks/cluster/controller/request.zeek¶
-
ClusterController::Request
¶
This module implements a request state abstraction that both cluster controller and agent use to tie responses to received request events and be able to time-out such requests.
- Namespace
ClusterController::Request
- Imports
policy/frameworks/cluster/controller/config.zeek, policy/frameworks/cluster/controller/types.zeek
Summary¶
State Variables¶
|
A token request that serves as a null/nonexistant request. |
Types¶
Request records track each request’s state. |
|
Redefinitions¶
|
Events¶
This event fires when a request times out (as per the ClusterController::request_timeout) before it has been finished via ClusterController::Request::finish(). |
Functions¶
This function establishes request state. |
|
This function marks a request as complete and causes Zeek to release its internal state. |
|
This function is a helper predicate to indicate whether a given request is null. |
|
This function looks up the request for a given request ID and returns it. |
|
For troubleshooting, this function renders a request record to a string. |
Detailed Interface¶
State Variables¶
- ClusterController::Request::null_req¶
- Type
- Default
{ id="" parent_id=<uninitialized> results=[] finished=T set_configuration_state=<uninitialized> supervisor_state=<uninitialized> test_state=<uninitialized> }
A token request that serves as a null/nonexistant request.
Types¶
- ClusterController::Request::Request¶
- Type
-
- id:
string
Each request has a hopfully unique ID provided by the requester.
- parent_id:
string
&optional
For requests that result based upon another request (such as when the controller sends requests to agents based on a request it received by the client), this specifies that original, “parent” request.
results:
ClusterController::Types::ResultVec
&default
=[]
&optional
finished:
bool
&default
=F
&optional
set_configuration_state:
ClusterController::Request::SetConfigurationState
&optional
supervisor_state:
ClusterController::Request::SupervisorState
&optional
test_state:
ClusterController::Request::TestState
&optional
- id:
Request records track each request’s state.
Events¶
- ClusterController::Request::request_expired¶
- Type
This event fires when a request times out (as per the ClusterController::request_timeout) before it has been finished via ClusterController::Request::finish().
- Req
the request state that is expiring.
Functions¶
- ClusterController::Request::create¶
- Type
function
(reqid:string
&default
=9Ye7pQPhuMe
&optional
) :ClusterController::Request::Request
This function establishes request state.
- Reqid
the identifier to use for the request.
- ClusterController::Request::finish¶
-
This function marks a request as complete and causes Zeek to release its internal state. When the request does not exist, this does nothing.
- Reqid
the ID of the request state to releaase.
- ClusterController::Request::is_null¶
- Type
function
(request:ClusterController::Request::Request
) :bool
This function is a helper predicate to indicate whether a given request is null.
- Request
a Request record to check.
- Returns
T if the given request matches the null_req instance, F otherwise.
- ClusterController::Request::lookup¶
- Type
function
(reqid:string
) :ClusterController::Request::Request
This function looks up the request for a given request ID and returns it. When no such request exists, returns ClusterController::Request::null_req.
- Reqid
the ID of the request state to retrieve.
- ClusterController::Request::to_string¶
- Type
function
(request:ClusterController::Request::Request
) :string
For troubleshooting, this function renders a request record to a string.
- Request
the request to render.