bec_lib.endpoints.MessageEndpoints#

class MessageEndpoints[source]#

Bases: object

Class for message endpoints.

Methods

account

Endpoint for account.

alarm

Endpoint for alarms.

available_scans

Endpoint for available scans.

bluesky_events

Endpoint for bluesky events.

dap_available_plugins

Endpoint for available DAP plugins.

dap_config

Endpoint for DAP configuration.

dap_request

Endpoint for DAP request.

dap_response

Endpoint for DAP response.

dataset_number

Endpoint for dataset number.

device_async_readback

Endpoint for receiving an async device readback over Redis streams.

device_config

Endpoint for device config.

device_config_history

Endpoint for device config history.

device_config_request

Endpoint for device config request.

device_config_request_response

Endpoint for device config request response.

device_config_update

Endpoint for device config update.

device_info

Endpoint for device info.

device_instructions

Endpoint for device instructions.

device_limits

Endpoint for device limits.

device_monitor

Endpoint for device monitoring.

device_progress

Endpoint for device progress.

device_read

Endpoint for device readings.

device_read_configuration

Endpoint for device configuration readings.

device_readback

Endpoint for device readbacks.

device_req_status

Endpoint for device request status.

device_req_status_container

Endpoint for device request status container.

device_rpc

Endpoint for device rpc.

device_server_config_request

Endpoint for device server config request.

device_staged

Endpoint for the device stage status.

device_status

Endpoint for device status.

file_content

Endpoint for file content.

file_event

Endpoint for public file_event.

global_vars

Endpoint for global variables.

gui_config

Endpoint for GUI configuration.

gui_data

Endpoint for GUI data.

gui_heartbeat

Endpoint for GUI heartbeat.

gui_instruction_response

Endpoint for GUI instruction response.

gui_instructions

Endpoint for GUI instructions.

log

Endpoint for log.

logbook

Endpoint for logbook.

metrics

Endpoint for metrics.

observer

Endpoint for observer.

pre_scan_macros

Endpoint for pre scan macros.

processed_data

Endpoint for processed data.

progress

Endpoint for progress.

public_file

Endpoint for public file.

public_scan_baseline

Endpoint for public scan baseline readings.

public_scan_info

Endpoint for scan info.

public_scan_segment

Endpoint for public scan segments.

scan_baseline

Endpoint for scan baseline readings.

scan_number

Endpoint for scan number.

scan_queue_history

Endpoint for scan queue history.

scan_queue_insert

Endpoint for scan queue inserts.

scan_queue_modification

Endpoint for scan queue modification.

scan_queue_modification_request

Endpoint for scan queue modification request.

scan_queue_request

Endpoint for scan queue request.

scan_queue_request_response

Endpoint for scan queue request response.

scan_queue_status

Endpoint for scan queue status.

scan_segment

Endpoint for scan segment.

scan_status

Endpoint for scan status.

scibec

Endpoint for scibec.

service_response

Endpoint for service response.

service_status

Endpoint for service status.

static account() EndpointInfo[source]#

Endpoint for account. This endpoint is used to publish the current account.

Returns:

Endpoint for account.

Return type:

EndpointInfo

static alarm() EndpointInfo[source]#

Endpoint for alarms. This endpoint is used by the redis connector to publish alarms using a messages.AlarmMessage message.

Returns:

Endpoint for alarms.

Return type:

EndpointInfo

static available_scans() EndpointInfo[source]#

Endpoint for available scans. This endpoint is used to publish the available scans using an AvailableResourceMessage.

Returns:

Endpoint for available scans.

Return type:

EndpointInfo

static bluesky_events() str[source]#

Endpoint for bluesky events. This endpoint is used by the scan bundler to publish the bluesky events using a direct msgpack dump of the bluesky event.

Returns:

Endpoint for bluesky events.

Return type:

str

static dap_available_plugins(plugin_id: str) EndpointInfo[source]#

Endpoint for available DAP plugins. This endpoint is used to publish the available DAP plugins using a messages.AvailableResourceMessage message.

Parameters:

plugin_id (str) – Plugin ID.

Returns:

Endpoint for available DAP plugins.

Return type:

EndpointInfo

static dap_config() EndpointInfo[source]#

Endpoint for DAP configuration. This endpoint is used to publish the DAP configuration using a messages.DAPConfigMessage message.

Returns:

Endpoint for DAP configuration.

Return type:

EndpointInfo

static dap_request() EndpointInfo[source]#

Endpoint for DAP request. This endpoint is used to request a DAP using a messages.DAPRequestMessage message.

Returns:

Endpoint for DAP request.

Return type:

EndpointInfo

static dap_response(RID: str) EndpointInfo[source]#

Endpoint for DAP response. This endpoint is used to publish the DAP response using a messages.DAPResponseMessage message.

Parameters:

RID (str) – Request ID.

Returns:

Endpoint for DAP response.

Return type:

EndpointInfo

static dataset_number() EndpointInfo[source]#

Endpoint for dataset number. This endpoint is used to publish the dataset number. The dataset number is incremented after each dataset and set in redis as an integer.

Returns:

Endpoint for dataset number.

Return type:

EndpointInfo

static device_async_readback(scan_id: str, device: str) EndpointInfo[source]#

Endpoint for receiving an async device readback over Redis streams. This endpoint is used by the device server to publish async device readbacks using a messages.DeviceMessage. In addition tp scan metadata, the message metadata contains information on how to concatenate multiple readings. Further keyword arguments for GUI handling might be attached.

Parameters:
  • scan_id (str) – unique scan identifier

  • device (str) – Device name, e.g. “mcs”.

Returns:

Endpoint for device async readback of the specified device.

Return type:

EndpointInfo

static device_config() EndpointInfo[source]#

Endpoint for device config. This endpoint is used by the scihub connector to set the device config.

Returns:

Endpoint for device config.

Return type:

EndpointInfo

static device_config_history() EndpointInfo[source]#

Endpoint for device config history. This endpoint is used to keep track of the device config history using a messages.AvailableResourceMessage message. The endpoint is connected to a redis list.

Returns:

Endpoint for device config history.

Return type:

EndpointInfo

static device_config_request() EndpointInfo[source]#

Endpoint for device config request. This endpoint can be used to request a modification to the device config. The request is sent using a messages.DeviceConfigMessage message.

Returns:

Endpoint for device config request.

Return type:

EndpointInfo

static device_config_request_response(RID: str) EndpointInfo[source]#

Endpoint for device config request response. This endpoint is used by the device server and scihub connector to inform about whether the device config request was accepted or rejected. The response is sent using a messages.RequestResponseMessage message.

Parameters:

RID (str) – Request ID.

Returns:

Endpoint for device config request response.

Return type:

EndpointInfo

static device_config_update() EndpointInfo[source]#

Endpoint for device config update. This endpoint is used by the scihub connector to inform about a change to the device config. The update is sent using a messages.DeviceConfigMessage message.

Returns:

Endpoint for device config update.

Return type:

EndpointInfo

static device_info(device: str) EndpointInfo[source]#

Endpoint for device info. This endpoint is used by the device server to publish the device info using a messages.DeviceInfoMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device info of the specified device.

Return type:

EndpointInfo

static device_instructions() EndpointInfo[source]#

Endpoint for device instructions. This endpoint is used by the scan server to publish the device instructions using a messages.DeviceInstructionMessage message. The device instructions are used to instruct the device server to perform certain actions, e.g. to move a motor.

Returns:

Endpoint for device instructions.

Return type:

EndpointInfo

static device_limits(device: str) EndpointInfo[source]#

Endpoint for device limits. This endpoint is used by the device server to publish the device limits using a messages.DeviceMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device limits of the specified device.

Return type:

EndpointInfo

static device_monitor(device: str) EndpointInfo[source]#

Endpoint for device monitoring. This endpoint is used to publish image or wavefrom data from a monitor. An example can be a 2D area dertector or a 1D waveform (XRF), for which we forward a subset from the data to the monitoring endpoing for visualization purposes. Details on shape and type of data need to be specified in dtype/dshape of the dev.<device>.describe() method.

Parameters:

device (str) – Device name, e.g. “eiger”.

Returns:

Endpoint for device monitoring.

Return type:

EndpointInfo

static device_progress(device: str) EndpointInfo[source]#

Endpoint for device progress. This endpoint is used by the device server to publish the device progress using a messages.ProgressMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device progress of the specified device.

Return type:

EndpointInfo

static device_read(device: str) EndpointInfo[source]#

Endpoint for device readings. This endpoint is used by the device server to publish the device readings using a messages.DeviceMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device readings of the specified device.

Return type:

EndpointInfo

static device_read_configuration(device: str) EndpointInfo[source]#

Endpoint for device configuration readings. This endpoint is used by the device server to publish the device configuration readings using a messages.DeviceMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device configuration readings of the specified device.

Return type:

EndpointInfo

static device_readback(device: str) EndpointInfo[source]#

Endpoint for device readbacks. This endpoint is used by the device server to publish the device readbacks using a messages.DeviceMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device readbacks of the specified device.

Return type:

EndpointInfo

static device_req_status(device: str) EndpointInfo[source]#

Endpoint for device request status. This endpoint is used by the device server to publish the device request status using a messages.DeviceReqStatusMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for device request status of the specified device.

Return type:

EndpointInfo

static device_req_status_container(RID: str) EndpointInfo[source]#

Endpoint for device request status container. This endpoint is used by the device server to publish the device request status using a messages.DeviceReqStatusMessage message.

Parameters:

RID (str) – Request ID.

Returns:

Endpoint for device request status container.

Return type:

EndpointInfo

static device_rpc(rpc_id: str) EndpointInfo[source]#

Endpoint for device rpc. This endpoint is used by the device server to publish the result of a device rpc using a messages.DeviceRPCMessage message.

Parameters:

rpc_id (str) – RPC ID.

Returns:

Endpoint for device rpc.

Return type:

EndpointInfo

static device_server_config_request() EndpointInfo[source]#

Endpoint for device server config request. This endpoint can be used to request changes to config. Typically used by the scihub connector following a device config request and validate a new configuration with the device server. The request is sent using a messages.DeviceConfigMessage message.

Returns:

Endpoint for device server config request.

Return type:

EndpointInfo

static device_staged(device: str) EndpointInfo[source]#

Endpoint for the device stage status. This endpoint is used by the device server to publish the device stage status using a messages.DeviceStatusMessage message. A device is staged when it is ready to be used in a scan. A DeviceStatus of 1 means that the device is staged, 0 means that the device is not staged.

Parameters:

device (str) – Device name, e.g. “samx”.

Returns:

Endpoint for the device stage status of the specified device.

Return type:

EndpointInfo

static device_status(device: str) EndpointInfo[source]#

Endpoint for device status. This endpoint is used by the device server to publish the device status using a messages.DeviceStatusMessage message.

Parameters:

device (str) – Device name, e.g. “samx”.

static file_content() EndpointInfo[source]#

Endpoint for file content. This endpoint is used by the file writer to publish the file content using a messages.FileContentMessage message.

Returns:

Endpoint for file content.

Return type:

EndpointInfo

static file_event(name: str) EndpointInfo[source]#

Endpoint for public file_event. This endpoint is used by the file writer to publish the status of the file writing using a messages.FileMessage message.

Parameters:

name (str) – File name.

Returns:

Endpoint for public file events.

Return type:

EndpointInfo

static global_vars(var_name: str) EndpointInfo[source]#

Endpoint for global variables. This endpoint is used to publish global variables using a messages.VariableMessage message.

Parameters:

var_name (str) – Variable name.

Returns:

Endpoint for global variables.

Return type:

EndpointInfo

static gui_config(gui_id: str) EndpointInfo[source]#

Endpoint for GUI configuration. This endpoint is used to publish the GUI configuration using a messages.GUIConfigMessage message.

Returns:

Endpoint for GUI configuration.

Return type:

EndpointInfo

static gui_data(gui_id: str) EndpointInfo[source]#

Endpoint for GUI data. This endpoint is used to publish the GUI data using a messages.GUIDataMessage message.

Returns:

Endpoint for GUI data.

Return type:

EndpointInfo

static gui_heartbeat(gui_id: str) EndpointInfo[source]#

Endpoint for GUI heartbeat. This endpoint is used to publish the GUI heartbeat using a messages.StatusMessage message.

Returns: EndpointInfo: Endpoint for GUI heartbeat.

static gui_instruction_response(RID: str) EndpointInfo[source]#

Endpoint for GUI instruction response. This endpoint is used to publish the GUI instruction response using a messages.RequestResponseMessage message.

Returns:

Endpoint for GUI instruction response.

Return type:

EndpointInfo

static gui_instructions(gui_id: str) EndpointInfo[source]#

Endpoint for GUI instructions. This endpoint is used to publish the GUI instructions using a messages.GUIInstructionMessage message.

Returns:

Endpoint for GUI instructions.

Return type:

EndpointInfo

static log() EndpointInfo[source]#

Endpoint for log. This endpoint is used by the redis connector to publish logs using a messages.LogMessage message.

Returns:

Endpoint for log.

Return type:

EndpointInfo

static logbook() EndpointInfo[source]#

Endpoint for logbook. This endpoint is used to publish logbook info such as url, user and token using a direct msgpack dump of a dictionary.

Returns:

Endpoint for logbook.

Return type:

EndpointInfo

static metrics(service_id: str) EndpointInfo[source]#

Endpoint for metrics. This endpoint is used by all BEC services to publish their performance metrics using a messages.ServiceMetricMessage message.

Parameters:

service_id (str) – Service ID, typically a uuid4 string.

Returns:

Endpoint for metrics.

Return type:

EndpointInfo

static observer() EndpointInfo[source]#

Endpoint for observer. This endpoint is used to keep track of observer states using a. messages.ObserverMessage message. This endpoint is currently not used.

Returns:

Endpoint for observer.

Return type:

EndpointInfo

static pre_scan_macros() EndpointInfo[source]#

Endpoint for pre scan macros. This endpoint is used to keep track of the pre scan macros. The endpoint is connected to a redis list.

Returns:

Endpoint for pre scan macros.

Return type:

EndpointInfo

static processed_data(process_id: str) EndpointInfo[source]#

Endpoint for processed data. This endpoint is used to publish new processed data streams using a messages.ProcessedDataMessage message.

Parameters:

process_id (str) – Process ID, typically a uuid4 string.

Returns:

Endpoint for processed data.

Return type:

EndpointInfo

static progress(var_name) EndpointInfo[source]#

Endpoint for progress. This endpoint is used to publish the current progress using a messages.ProgressMessage message.

Parameters:

var_name (str) – Variable name.

Returns:

Endpoint for progress.

Return type:

EndpointInfo

static public_file(scan_id: str, name: str) EndpointInfo[source]#

Endpoint for public file. This endpoint is used by the file writer to publish the status of the file writing using a messages.FileMessage message.

Parameters:
  • scan_id (str) – Scan ID.

  • name (str) – File name.

Returns:

Endpoint for public files.

Return type:

EndpointInfo

static public_scan_baseline(scan_id: str) EndpointInfo[source]#

Endpoint for public scan baseline readings. This endpoint is used by the scan bundler to publish the scan baseline readings using a messages.ScanBaselineMessage message. In contrast to the scan_baseline endpoint, this endpoint is specific to a scan and has a retention time of 30 minutes.

Parameters:

scan_id (str) – Scan ID.

Returns:

Endpoint for public scan baseline readings.

Return type:

EndpointInfo

static public_scan_info(scan_id: str) EndpointInfo[source]#

Endpoint for scan info. This endpoint is used by the scan worker to publish the scan info using a messages.ScanStatusMessage message. In contrast to the scan_info endpoint, this endpoint is specific to a scan and has a retentioni time of 30 minutes.

Parameters:

scan_id (str) – Scan ID.

Returns:

Endpoint for scan info.

Return type:

EndpointInfo

static public_scan_segment(scan_id: str, point_id: int) EndpointInfo[source]#

Endpoint for public scan segments. This endpoint is used by the scan bundler to publish the scan segment using a messages.ScanMessage message. In contrast to the scan_segment endpoint, this endpoint is specific to a scan and has a retention time of 30 minutes.

Parameters:
  • scan_id (str) – Scan ID.

  • point_id (int) – Point ID to specify a single point in a scan.

Returns:

Endpoint for public scan segments.

Return type:

EndpointInfo

static scan_baseline() EndpointInfo[source]#

Endpoint for scan baseline readings. This endpoint is used by the scan bundler to publish the scan baseline readings using a messages.ScanBaselineMessage message.

Returns:

Endpoint for scan baseline readings.

Return type:

EndpointInfo

static scan_number() EndpointInfo[source]#

Endpoint for scan number. This endpoint is used to publish the scan number. The scan number is incremented after each scan and set in redis as an integer.

Returns:

Endpoint for scan number.

Return type:

EndpointInfo

static scan_queue_history() EndpointInfo[source]#

Endpoint for scan queue history. This endpoint is used to keep track of the scan queue history using a messages.ScanQueueHistoryMessage message. The endpoint is connected to a redis list.

Returns:

Endpoint for scan queue history.

Return type:

EndpointInfo

static scan_queue_insert() EndpointInfo[source]#

Endpoint for scan queue inserts. This endpoint is used to publish accepted scans using a messages.ScanQueueMessage message. The message will be picked up by the scan queue manager and inserted into the scan queue.

Returns:

Endpoint for scan queue inserts.

Return type:

EndpointInfo

static scan_queue_modification() EndpointInfo[source]#

Endpoint for scan queue modification. This endpoint is used to publish accepted scan queue modifications using a messages.ScanQueueModificationMessage message.

Returns:

Endpoint for scan queue modification.

Return type:

EndpointInfo

static scan_queue_modification_request() EndpointInfo[source]#

Endpoint for scan queue modification request. This endpoint is used to request a scan queue modification using a messages.ScanQueueModificationMessage message. If accepted, the modification is published using the scan_queue_modification endpoint.

Returns:

Endpoint for scan queue modification request.

Return type:

EndpointInfo

static scan_queue_request() EndpointInfo[source]#

Endpoint for scan queue request. This endpoint is used to request the new scans. The request is sent using a messages.ScanQueueMessage message.

Returns:

Endpoint for scan queue request.

Return type:

EndpointInfo

static scan_queue_request_response() EndpointInfo[source]#

Endpoint for scan queue request response. This endpoint is used to publish the information on whether the scan request was accepted or rejected. The response is sent using a messages.RequestResponseMessage message.

Returns:

Endpoint for scan queue request response.

Return type:

EndpointInfo

static scan_queue_status() EndpointInfo[source]#

Endpoint for scan queue status. This endpoint is used to publish the scan queue status using a messages.ScanQueueStatusMessage message.

Returns:

Endpoint for scan queue status.

Return type:

EndpointInfo

static scan_segment() EndpointInfo[source]#

Endpoint for scan segment. This endpoint is used by the scan bundler to publish the scan segment using a messages.ScanMessage message.

Returns:

Endpoint for scan segment.

Return type:

EndpointInfo

static scan_status() EndpointInfo[source]#

Endpoint for scan status. This endpoint is used to publish the scan status using a messages.ScanStatusMessage message.

Returns:

Endpoint for scan status.

Return type:

EndpointInfo

static scibec() EndpointInfo[source]#

Endpoint for scibec. This endpoint is used to publish scibec info such as url, user and token using a CredentialsMessage.

Returns:

Endpoint for scibec.

Return type:

EndpointInfo

static service_response(RID: str) EndpointInfo[source]#

Endpoint for service response. This endpoint is used by all BEC services to publish the result of a service request using a messages.ServiceResponseMessage message.

Parameters:

RID (str) – Request ID.

Returns:

Endpoint for service response.

Return type:

EndpointInfo

static service_status(service_id: str) EndpointInfo[source]#

Endpoint for service status. This endpoint is used by all BEC services to publish their status using a messages.StatusMessage message. The status message also contains the service info such as user, host, etc.

Parameters:

service_id (str) – Service ID, typically a uuid4 string.

Returns:

Endpoint for service status.

Return type:

EndpointInfo