Skip to content

flowmachine.core.server.action_handlers

action_handler__get_aggregation_unit

action_handler__get_aggregation_unit(config: 'FlowmachineServerConfig', **action_params: dict) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_aggregation_unit' action. Returns the aggregation unit associated with the specified query, if it has one, or None otherwise. The purpose of this action is to be able to get the aggregation unit associated with any spatial aggregate query, even if the query does not have an explicit 'aggregation_unit' parameter. Note: this action should not require construction of the underlying flowmachine query object - aggregation unit information should be available in the exposed query object produced by deserialising the query parameters.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_available_dates

action_handler__get_available_dates(config: 'FlowmachineServerConfig') -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_available_dates' action. Returns a dict of the form {"calls": [...], "sms": [...], ...}.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

    The reply from the action handler.

action_handler__get_available_queries

action_handler__get_available_queries(config: 'FlowmachineServerConfig') -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for 'get_available_queries' action. Returns a list of available flowmachine queries.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_geo_sql

action_handler__get_geo_sql(config: 'FlowmachineServerConfig', query_id: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_sql' action. Returns a SQL string which can be run against flowdb to obtain the result of the query with given query_id.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_geography

action_handler__get_geography(config: 'FlowmachineServerConfig', aggregation_unit: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_query_geography' action. Returns SQL to get geography for the given aggregation_unit as GeoJSON.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_qa_checks

action_handler__get_qa_checks(config: 'FlowmachineServerConfig', cdr_type: str, start_date: str, end_date: str, check_type: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

action_handler__get_query_kind

action_handler__get_query_kind(config: 'FlowmachineServerConfig', query_id: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_query_kind' action. Returns query kind of the query with the given query_id.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_query_params

action_handler__get_query_params(config: 'FlowmachineServerConfig', query_id: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_query_params' action. Returns query parameters of the query with the given query_id.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_query_schemas

action_handler__get_query_schemas(config: 'FlowmachineServerConfig') -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_query_schemas' action. Returns a dict with all supported flowmachine queries as keys and the associated schema for the query parameters as values.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__get_sql

action_handler__get_sql(config: 'FlowmachineServerConfig', query_id: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'get_sql' action. Returns a SQL string which can be run against flowdb to obtain the result of the query with given query_id.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__list_qa_checks

action_handler__list_qa_checks(config: 'FlowmachineServerConfig')
Source: flowmachine/core/server/action_handlers.py

action_handler__ping

action_handler__ping(config: 'FlowmachineServerConfig') -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for 'ping' action. Returns the message 'pong'.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__poll_query

action_handler__poll_query(config: 'FlowmachineServerConfig', query_id: str) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'poll_query' action. Returns the status of the query with the given query_id.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

action_handler__run_query

action_handler__run_query(config: 'FlowmachineServerConfig', **action_params: dict) -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Handler for the 'run_query' action. Constructs a flowmachine query object, sets it running and returns the query_id. For this action handler the action_params are exactly the query kind plus the parameters needed to construct the query.

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

get_action_handler

get_action_handler(action: str) -> Callable
Source: flowmachine/core/server/action_handlers.py

Exception should be raised for handlers that don't exist.

Returns

  • typing.Callable

perform_action

perform_action(action_name: str, action_params: dict, *, config: 'FlowmachineServerConfig') -> flowmachine.core.server.zmq_helpers.ZMQReply
Source: flowmachine/core/server/action_handlers.py

Perform action with the given action parameters.

Parameters

  • action_name: str

    The action to be performed.

  • action_params: dict

    Parameters for the action handler.

  • config: FlowmachineServerConfig

    Server config options

Returns

  • flowmachine.core.server.zmq_helpers.ZMQReply

    The reply from the action handler.