Run Engine Manager API
Asyncio-Based API for Controlling RE Manager
Asyncio-based API is designed for use in applications that employ asyncio event loop. For example, HTTP server module is using asyncio-based API for communication with RE Manager. Communication is performed by instantiating ZMQCommSendAsync class and awaiting ZMQCommSendAsync.send_message() function, which accepts the method name and parameters as arguments and returns the response message.
API for communication with RE Manager via ZMQ. |
|
Send message to ZMQ server and wait for the response. |
|
Close ZMQ socket. |
Thread-Based API for Controlling RE Manager
Thread-based API is designed for use in applications that are not based on asyncio event loop, such as PyQT applications or simple python scripts. Communication with RE Manager is performed by instantiating ZMQCommSendThreads class and calling ZMQCommSendThreads.send_message() function, which accepts the method name and parameters. The send_message() function may be called in blocking and non-blocking mode. In blocking mode, the function returns the response message. In non-blocking mode the function exits once ZMQ request is send to RE Manager and passes the response message to user-defined callback function once the response is received. The reference to the callback function is passed to send_message() function as one of the arguments.
Thread-based API for communication with RE Manager via ZMQ. |
|
Send message to ZMQ server and wait for the response. |
|
Close ZMQ socket. |
Supported Methods For ZMQ Communication API
Brief Reference
The following reference describes the methods used for controlling RE Manager. For each method, the documentation contains the description of outgoing and returned parameters. Method name and the dictionary of method parameters are passed as arguments to send_message() API function.
The result of the request processing is returned as a dictionary of the returned parameters by send_message() function or passed as an argument of the callback. In case of communication error, send_message function may raise the exception (default) or return the error message. If reference to a callback function is passed to send_message (in thread-based API), the communication error message will be passed as msg_err parameter of the callback function
Get status and configuration information from RE Manager:
Existing and allowed plans and devices:
History of executed plans:
Open and close RE Worker environment:
Operations with the plan queue:
Start and stop execution of the plan queue:
Send commands to Bluesky Run Engine:
Monitor the list of active runs:
Run tasks in RE Worker namespace:
Lock/unlock RE Manager:
Management of IPython kernel (IPython mode):
Stopping RE Manager (mostly used in testing):
Detailed Reference
‘ping’
Method |
‘ping’ |
Description |
Causes RE Manager to send some predefined response. Currently ‘ping’ request is equivalent to ‘status’ request. The functionality may be changed in the future. Use ‘status’ method to request status information from RE Manager. The request always succeeds. |
Parameters |
— |
Returns |
See ‘status’ method for information on returned data. |
Execution |
Immediate: no follow-up requests are required. |
‘status’
Method |
‘status’ |
Description |
Returns status of RE Manager. The request always succeeds. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘config_get’
Method |
‘config_get’ |
Description |
Returns config info for RE Manager. The request always succeeds. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘plans_allowed’
Method |
‘plans_allowed’ |
Description |
Returns a dictionary that contains information on the allowed plans for a given user group. Monitor ‘plans_allowed_uid’ status field and download the list from the server only when the UID is changed. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘devices_allowed’
Method |
‘devices_allowed’ |
Description |
Returns a dictionary that contains information on the allowed devices for a given user group. Monitor ‘devices_allowed_uid’ status field and download the list from the server only when the UID is changed. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘plans_existing’
Method |
‘plans_existing’ |
Description |
Returns a dictionary that contains information on existing plans in the RE Worker namespace. Monitor ‘plans_existing_uid’ status field and download the list from the server only when the UID is changed. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘devices_existing’
Method |
‘devices_existing’ |
Description |
Returns a dictionary that contains information on the existing devices in RE Worker namespace. Monitor ‘devices_existing_uid’ status field and download the list from the server only when the UID is changed. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘permissions_reload’
Method |
‘permissions_reload’ |
Description |
Reload user group permissions from the default location or the location set using command line parameters and generate lists of allowed plans and devices based on the lists of existing plans and devices. By default, the method will use current lists of existing plans and devices stored in memory. Optionally the method can reload the lists from the disk file (see restore_plans_devices parameter). The method always updates UIDs of the lists of allowed plans and devices even if the contents remain the same. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘permissions_get’
Method |
‘permissions_get’ |
Description |
Download the dictionary of user group permissions currently used by RE Manager. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘permissions_set’
Method |
‘permissions_set’ |
Description |
Uploads the dictionary of user group permissions. If the uploaded dictionary contains a valid set of permissions different from currently used one, the new permissions are set as current and the updated lists of allowed plans and devices are generated. The method does nothing if the uploaded permissions are identical to currently used permissions. The API request fails if the uploaded dictionary does not pass validation. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘history_get’
Method |
‘history_get’ |
Description |
Returns the list of items in the plan history. The request always succeeds. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘history_clear’
Method |
‘history_clear’ |
Description |
Clear the contents of the plan history. The request always succeeds. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘environment_open’
Method |
‘environment_open’ |
Description |
Initiate the creation of a new RE Worker environment. The request will succeed only if RE Manager is in ‘idle’ state and the environment does not exist. RE Worker environment must be created before plans could be executed. To restart the environment, close the existing environment first by sending ‘environment_close’ request. To destroy ‘frozen’ environment, use ‘environment_destroy’ method. |
Parameters |
|
Returns |
|
Execution |
The request only initiates the sequence of creating a new environment. It may take a long time to start the environment. Monitor ‘manager_state’ and ‘worker_environment_exists’ status fields (‘status’ method) to detect when the operation is completed: ‘manager_state’ should have the value ‘opening_environment’ while operation is in progress and change to ‘idle’ when the operation completes and ‘worker_environment_exists’ is set to True if environment was created successfully. |
‘environment_close’
Method |
‘environment_close’ |
Description |
Initiate the operation of closing the existing RE Worker environment. Fails if there is no existing environment or if RE Manager is not in ‘idle’ state. Use ‘environment_destroy’ method to close a non-responsive RE Worker environment. |
Parameters |
|
Returns |
|
Execution |
The request initiates the sequence of closing the environment. Monitor ‘manager_state’ and ‘worker_environment_exists’ status fields (see ‘status’ method) to detection when the operation coompletes: ‘manager_state’ is expected to have the value ‘closing_environment’ while operation is in progress and switch to ‘idle’ when the operation completes and ‘worker_environment_exists’ is set False if environment was closed successfully. |
‘environment_destroy’
Method |
‘environment_destroy’ |
Description |
Initiate the operation of destroying of the existing (unresponsive) RE Worker environment. The operation fails if there is no existing environment. The request is accepted by the server if status fields worker_environment_exists is True or manager_state is ‘creating_environment’, otherwise the request is rejected. |
Parameters |
|
Returns |
|
Execution |
The request initiates the sequence of destroying the environment. Monitor ‘manager_state’ and ‘worker_environment_exists’ status fields (see ‘status’ method): ‘manager_state’ is expected to have the value ‘destroying_environment’ while operation is in progress and switch to ‘idle’ when the operation completes and ‘worker_environment_exists’ is set False if environment was destroyed successfully. |
‘environment_update’
Method |
‘environment_update’ |
Description |
Update the state and cached parameters of the worker environment based on contents of the worker namespace. The updated parameters include the reference to the Run Engine and lists of existing and available plans and devices. The API is intended for using in cases when users bypass RE Manager to modify contents of the namespace, for example by connecting directly to IPython kernel (IPython mode) and executing commands via Jupyter Console. |
Parameters |
|
Returns |
|
Execution |
The request initiates the update. The update is not instant, especially if the namespace is large. Monitor ‘manager_state’ (foreground task) or use ‘task_uid’ to check if the task execution is completed or the update is successful. |
‘queue_mode_set’
Method |
‘queue_mode_set’ |
Description |
Sets parameters that define the mode of plan queue execution. The key/value pairs of the ‘mode’ dictionary represent names and values of the parameters that need to be changed. If mode={} then the mode will not be changed. To reset the mode parameters to the built-in default values, set mode=”default”. The request fails if the ‘mode’ parameter is not a dictionary or the ‘default’ string, the dictionary contains unsupported keys (mode parameters) or key values are of unsupported type. Supported mode parameters (dictionary keys): ‘loop’ (True/False) - enables/disables loop mode; ‘ignore_failures’ (True/False) - enables/disables the option to continue execution of the queue after a plan fails. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_get’
Method |
‘queue_get’ |
Description |
Returns the items in the plan queue. The returned list of items may contain plans or instructions. Each item is represented as a dictionary. Plans and instructions can be distinguished by checking the value with the key ‘item_type’: ‘plan’ indicates that the item is a plan, while ‘instruction’ indicates that it is an instruction. The request always succeeds. |
Parameters |
— |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_add’
Method |
‘queue_item_add’ |
Description |
Add item to the queue. The item may be a plan or an instruction. By default the item is added to the back of the queue. Alternatively the item can be placed at the desired position in the queue or before or after one of the existing items. |
Parameters |
Parameters ‘pos’, ‘before_uid’ and ‘after_uid’ are mutually exclusive. |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_add_batch’
Method |
‘queue_item_add_batch’ |
Description |
Add a batch of items to the queue. The behavior of the function is identical to queue_item_add, except that it adds the batch of items instead of a single item. The batch may consist of any number of supported items (see queue_item_add method). Each item in the queue must successfully pass validation before any items are added to the queue. If an item fails validation, the whole batch is rejected. In case the batch is rejected, the function returns the detailed report for each item: success status indicating if the item passed validation and error message in case validation failed. |
Parameters |
Parameters ‘pos’, ‘before_uid’ and ‘after_uid’ are mutually exclusive. |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_update’
Method |
‘queue_item_update’ |
Description |
Update the existing item in the queue. The method is intended for editing queue items, but may be used for replacing the existing items with completely different ones. The updated item may be a plan or an instruction. The item parameter ‘item_uid’ must be set to a UID of an existing queue item that is expected to be replaced. The method fails if the item UID is not found. By default, the UID of the updated item is not changed and ‘user’ and ‘user_group’ parameters are set to the values provided in the request. The ‘user_group’ is also used for validation of submitted item. If it is preferable to replace the item UID with a new random UID (e.g. if the item is replaced with completely different item), the method should be called with the optional parameter ‘replace=True’. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_get’
Method |
‘queue_item_get’ |
Description |
Read item from the queue. By default the item from the back of the queue is returned. Alternatively the item at the given position or the item with the given UID may be requested. |
Parameters |
Parameters ‘pos’ and ‘uid’ are mutually exclusive. |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_remove’
Method |
‘queue_item_remove’ |
Description |
Remove item from the queue. By default the last item in the queue is removed. Alternatively the position or UID of the item can be specified. |
Parameters |
Parameters ‘pos’ and ‘uid’ are mutually exclusive. |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_remove_batch’
Method |
‘queue_item_remove_batch’ |
Description |
Remove a batch of items from the queue. The batch of items is defined as a list of item UIDs and passed as the parameter ‘uids’. The list of UIDs may be empty. By default, the function does not validate the batch and deletes all batch items found in the queue. Batch validation may be enabled by setting ‘ignore_missing=False’. In this case the method succeeds only if the batch does not contain repeated items and all items are found in the queue. If validation fails then no items are removed from the queue. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_move’
Method |
‘queue_item_move’ |
Description |
Move item to a different position in the queue. |
Parameters |
Parameters ‘pos’ and ‘uid’ are mutually exclusive, but at least one of them must be specified. Parameters ‘pos_dest’, ‘before_uid’ and ‘after_uid’ are mutually exclusive, but at least one of them must be specified. |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_move_batch’
Method |
‘queue_item_move_batch’ |
Description |
Move a batch of item to a different position in the queue. The method accepts a list of UIDs of the items included in the batch. The UIDs in the list must be unique (not repeated) and items with listed UIDs must exist in the queue. If the list is empty, then operation succeeds and the queue remains unchanged. The destination must be specified using one of the mutually exclusive parameters ‘pos_dest’, ‘before_uid’ or ‘after_uid’. The reference item with the UID of passed with the parameters ‘before_uid’ or ‘after_uid’ must not be in the batch. The parameter ‘reorder’ controls the order of the items in the moved batch and indicates whether items in the batch should be reordered with respect to the order of UIDs in the list ‘uids’. The batch may include any set of non-repeated items from the queue arranged in arbitrary order. By default (reorder=False) the batch is inserted in the specified position as a contiguous sequence of items ordered according to the UIDs in the list ‘uids’. If reorder=True, then the inserted items are ordered according to their original positions in the queue. It is assumed that the method will be mostly used with the default ordering option and user will be responsible for creating properly ordered lists of items. The other option is implemented for the cases when the user may want to submit randomly ordered lists of UIDs, but preserve the original order of the moved batch. |
Parameters |
Parameters ‘pos_dest’, ‘before_uid’ and ‘after_uid’ are mutually exclusive, but at least one of them must be specified. |
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_item_execute’
Method |
‘queue_item_execute’ |
Description |
Immediately start execution of the submitted item. The item may be a plan or an instruction. The request fails if item execution can not be started immediately (RE Manager is not in IDLE state, RE Worker environment does not exist, etc.). If the request succeeds, the item is executed once. The item is not added to the queue if it can not be immediately started and it is not pushed back into the queue in case its execution fails/stops. If the queue is in the LOOP mode, the executed item is not added to the back of the queue after completion. The API request does not alter the sequence of enqueued plans. The API is primarily intended for implementing of interactive workflows, in which users are controlling the experiment using client GUI application and user actions (such as mouse click on a plot) are converted into the requests to execute plans in RE Worker environment. Interactive workflows may be used for calibration of the instrument, while the queue may be used to run sequences of scheduled experiments. The item is not added to the queue or change the existing queue. The API modifies plan_queue_uid status parameter, which is used for monitoring updates of the queue and running items. If the item is a plan, the results of execution are added to plan history as usual. The respective history item could be accessed to check if the plan was executed successfully. The API does not start execution of the queue. Once execution of the submitted item is finished, RE Manager is switched to the IDLE state. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_clear’
Method |
‘queue_clear’ |
Description |
Remove all items from the plan queue. The currently running plan does not belong to the queue and is not affected by this operation. If the plan fails or its execution is stopped, it will be pushed to the beginning of the queue. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_start’
Method |
‘queue_start’ |
Description |
Start execution of the queue. The operation succeeds only if RE Manager is in ‘idle’ state and RE Worker environment exists. This operation only initiates the process of starting the execution of the queue. |
Parameters |
|
Returns |
|
Execution |
The request initiates the operation of starting the queue. Verify that the queue is running by checking the status fields: ‘manager_state’ is expected to have the value ‘executing_queue’ and ‘running_item_uid’ should return UID of the running plan. It is possible that the queue execution is successfully started, but immediately stopped (queue is empty, queue contains a very short plan, the first plan in the queue fails to start, the first item in the queue is ‘queue_stop’ instruction etc.). RE Manager is expected to handle those cases in orderly way, but the client should be capable of detecting and handling those events as well. |
‘queue_stop’
Method |
‘queue_stop’ |
Description |
Request RE Manager to stop execution of the queue after completion of the currently running plan. The request succeeds only if the queue is currently running (‘manager_state’ status field has value ‘executing_queue’). The ‘queue_stop_pending’ status field can be used at any time to verify if the request is pending. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_stop_cancel’
Method |
‘queue_stop_cancel’ |
Description |
Cancel the pending request to stop execution of the queue after the currently running plan. The request always succeeds. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘queue_autostart’
Method |
‘queue_autostart’ |
Description |
Enable/disable autostart mode. In autostart mode, the queue execution is automatically started whenever the queue contains items and the manager and the environment are ready to execute plans. Client applications may check if the manager is in autostart mode using queue_autostart_enabled parameter of RE Manager status (see ‘status’ API).The autostart mode is not disabled after the queue runs out of items, but is automatically restarted once new items are added. The autostart mode is disabled if the API is called with enable=False, or if the queue or the running plan is stopped due to the following events:
The autostart mode may be enabled/disabled at any time. If the queue contains items, but queue can not be started immediately, e.g. due to environment being closed, the manager periodically checks the state of the manager and the worker and will attempt to start the queue once the manager and the worker are ready. If the queue runs out of items, the manager returns to IDLE state and will accept requests to execute foreground tasks: run a plan (‘queue_item_execute’ API), a function (‘function_execute’ API) or a script (‘script_upload’ API). If plans are added to the queue while the manager is busy, the queue is is automatically started once the task is complete. If a plan is paused by the manager and resumed (and runs to completion) or stopped in Jupyter console, the autostart mode is not disabled and the next plan is started. If the plan is aborted or halted in Jupyter Console, then the autostart is disabled. This behavior may change in the future. The request always succeeds. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘re_pause’
Method |
‘re_pause’ |
Description |
Request Run Engine to pause currently running plan. The request will fail if RE Worker environment does not exist or no plan is currently running. The request only initates the sequence of pausing the plan. If deferred pause is requested past the last checkpoint of the plan, the plan is run to completion and the queue is stopped. The stopped queue can not be resumed using re_resume method, instead queue_start method should be used to restart the queue. Check manager_state status flag to determine if the queue is stopped (‘idle’ state) or Run Engine is paused (‘paused’ state). The pause_pending status flag is set if pause request is successfully passed to Run Engine. It may take significant time for deferred pause to be processed. The flag is cleared once the pending pause request is processed (the plan is paused or plan is completed and the queue is stopped). |
Parameters |
|
Returns |
|
Execution |
The request only initiates the operation of pausing the plan. Wait until the plan is paused by polling ‘manager_state’ status field (expected value is ‘paused’). |
‘re_resume’, ‘re_stop’, ‘re_abort’, ‘re_halt’
Method |
‘re_resume’, ‘re_stop’, ‘re_abort’, ‘re_halt’ |
Description |
Request Run Engine to resume, stop, abort or halt a paused plan. Fails if RE Worker environment does not exist or ‘manager_state’ status field value is not ‘paused’. |
Parameters |
— |
Returns |
|
Execution |
The request only initiates the operation. Wait until the plan is paused by monitoring ‘manager_state’ status field (expected value is ‘executing_queue’ if execution is resumed or ‘idle’ if execution was stopped). |
‘re_runs’
Method |
‘re_runs’ |
Description |
Request the list of active runs generated by the currently executed plans. The full list of active runs includes the runs that are currently open (‘open’ runs) and the runs that were already closed (‘closed’ runs). Simple single-run plans will have at most one run in the list. Monitor ‘run_list_uid’ RE Manager status field and retrieve the updated list once UID is changed. The UID of the retrieved list is included in the returned parameters |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘script_upload’
Method |
‘script_upload’ |
Description |
Upload and execute script in RE Worker namespace. The script may add, change or replace objects defined in the namespace, including plans and devices. Dynamic modification of the worker namespace may be used to implement more flexible workflows. The API call updates the lists of existing and allowed plans and devices if necessary. Changes in the lists will be indicated by changed list UIDs. Use ‘task_result’ API to check if the script was loaded correctly. Note, that if the task fails, the script is still executed to the point where the exception is raised and the respective changes to the environment are applied. |
Parameters |
|
Returns |
|
Execution |
The method initiates the operation. Monitor task_results_uid status field and call task_result API to check for success. |
‘function_execute’
Method |
‘function_execute’ |
Description |
Start execution of a function in RE Worker namespace. The function must be defined in the namespace (in startup code or a script uploaded using script_upload method. The function may be executed as a foreground task (only if RE Manager and RE Worker environment are idle) or as a background task. Background tasks are executed in separate threads and may consume processing or memory resources and interfere with running plans or other tasks. RE Manager does not guarantee thread safety of the user code running in the background. Developers of startup code are fully responsible for preventing threading issues. The method allows to pass parameters (args and kwargs) to the function. Once the task is completed, the results of the function execution, including the return value, can be loaded using task_result method. If the task fails, the return value is None and the error message and traceback are included in the result. The data types of parameters and return values must be JSON serializable. The task fails if the return value can not be serialized. The method only initiates execution of the function. If the request is successful (success=True), the server starts the task, which attempts to execute the function with given name and parameters. The function may still fail start (e.g. if the user is permitted to execute function with the given name, but the function is not defined in the namespace). Use ‘task_result’ method with the returned task_uid to check the status of the tasks and load the result upon completion. |
Parameters |
|
Returns |
|
Execution |
The method initiates the operation. Monitor task_results_uid status field and call task_result API to check for success. |
‘task_status’
Method |
‘task_status’ |
Description |
Returns the status of one or more tasks executed by the worker process. The request must contain one or more valid task UIDs, returned by one of APIs that starts tasks. A single UID may be passed as a string, multiple UIDs must be passed as as a list of strings. If a UID is passed as a string, then the returned status is also a string, if a list of one or more UIDs is passed, then the status is a dictionary that maps task UIDs and their status. The completed tasks are stored at the server at least for the period determined by retention time (currently 120 seconds after completion of the task). The expired results could be automatically deleted at any time and the method will return the task status as ‘not_found’. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘task_result’
Method |
‘task_result’ |
Description |
Get the status and results of task execution. The completed tasks are stored at the server at least for the period determined by retention time (currently 120 seconds after completion of the task). The expired results could be automatically deleted at any time and the method will return the task status as ‘not_found’. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘lock’
Method |
‘lock’ |
Description |
Lock RE Manager with the provided lock key to prevent other clients from modifying the environment, starting plans or tasks or editing the queue. The lock is not intended for access control. The read-only API are not affected by the lock, therefore all monitoring client applications are expected to remain functional after the lock is applied. The lock does not influence internal operation of the manager, e.g. the running queue will continue running and has to be explicitly stopped if needed. Each lockable API has an optional parameter ‘lock_key’. Passing a valid lock key (used to lock RE Manager) with the API requests allows to control RE Manager while it is locked. This supports the scenarios when a beamline scientists locks RE Manager with a unique code before entering the hutch to change samples or make adjustments and then safely runs a series of calibration or testing plans without interference from automated agents or remote users. A remote operators may still control locked RE Manager if the beamline scientists provides them with the lock key. The API parameters allow to choose between locking the environment, the queue or both. Locking the environment affects the following API: Locking the queue affects the following API: The additional parameters include the name of the user (user, required) who locked RE Manager and the message to other users (note, optional) which may explain the reason why the manager is locked. The user name and the note is returned by lock_info API and included in the ‘Invalid lock key’ error messages. An emergency lock key may be optionally set using
Note Restarting RE Manager does not change the lock status. The manager has to be unlocked using the valid lock key or the emergency lock key. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘lock_info’
Method |
‘lock_info’ |
Description |
Load the lock status of RE Manager and optionally validate the lock key. Monitor lock_info_uid field of RE Manager status (see documentation for the ‘status’ API) to detect changes in lock status and download the lock status only when the UID changes. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘unlock’
Method |
‘unlock’ |
Description |
Unlock RE Manager with the lock key used to lock the manager or the emergency lock key. See the documentation for ‘lock’ API for more details. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘kernel_interrupt’
Method |
‘kernel_interrupt’ |
Description |
Send interrupt request (Ctrl-C) to the running IPython kernel. The API call fails if IPython mode is not enabled or environment does not exist (there is no IPython kernel). The API is primarily intended to interrupt tasks started by clients connected directly to IPython kernel (such as Jupyter Console) and by default it fails if the manager is executing a plan or a task. Set the interrupt_task and/or interrupt_plan parameters True in order to be able to interrupt a running foreground task or a plan (single interrupt initiates deferred pause, two consecutive interrupts initiate immediate pause). Note, that ‘re_pause’ API is more reliable method of pausing the plan. |
Parameters |
|
Returns |
|
Execution |
Immediate: no follow-up requests are required. |
‘manager_stop’
Method |
‘manager_stop’ |
Description |
Exit RE Manager application. Clients will probably not need to initiate exit remotely, but ability to do so is extremely useful for automated testing. |
Parameters |
|
Returns |
|
Execution |
The request only initiates the operation of exiting RE Manager. If the request succeeds it may be expected that RE Manager application will eventually be exited and stops it stops responding to requests. |
‘manager_kill’
Method |
‘manager_kill’ |
Description |
Freezes RE Manager process by stopping the asyncio event loop. By design, the manager process is expected to restart after 5 seconds of inactivity. The restart of the manager process should not affect the state of the queue or running plans. This function is implemented for testing purposes only. There is no practical reason for a client application to send this request. |
Parameters |
— |
Returns |
RE Manager will not respond to the request. |
Execution |
Immediate: no follow-up requests are required. |