BlissAPI (0.0.1)

Download OpenAPI specification:Download

A REST/WebSocket API for BLISS

Config

Get current config

Get the current UI configuration from beacon

This includes monitor settings, top and side items, and available layouts

Configuration is located in:
* beacon://blissterm/config.yml
* beacon://blissterm/layouts.yml

Responses

Response samples

Content type
application/json
{
  • "monitor": [
    ],
  • "topItems": [
    ],
  • "sideItems": [
    ],
  • "beamline": null,
  • "sessions": [
    ],
  • "activeSessions": [
    ],
  • "layouts": [
    ],
  • "layoutsError": null,
  • "session": "__DEFAULT__"
}

Console

Set terminal size

Set the terminal size for session_name in cols and rows

Request Body schema: application/json
session_name
required
string (Session Name)
w
required
integer (W)

Console width in columns

h
required
integer (H)

Console height in rows

Responses

Request samples

Content type
application/json
{
  • "session_name": "string",
  • "w": 0,
  • "h": 0
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Session

Get active MG

Get the current ACTIVE_MG from session_name with its list of enabled and available counters

path Parameters
session_name
required
string (Session Name)

Responses

Response samples

Content type
application/json
{
  • "session_name": "string",
  • "enabled": [
    ],
  • "available": [
    ],
  • "disabled": [
    ]
}

Update active MG

Update the enabled and disabled counters for the current ACTIVE_MG in session_name

path Parameters
session_name
required
string (Session Name)
Request Body schema: application/json
Array of Enabled (strings) or Enabled (null) (Enabled)
Default: null

A list of counters to enabled

Array of Disabled (strings) or Disabled (null) (Disabled)
Default: null

A list of counters to disable

Responses

Request samples

Content type
application/json
{
  • "enabled": null,
  • "disabled": null
}

Response samples

Content type
application/json
{
  • "session_name": "string",
  • "enabled": [
    ],
  • "available": [
    ],
  • "disabled": [
    ]
}

Get SCAN_SAVING

Get the current SCAN_SAVING settings for session_name

The returned values will depend on the type of scan saving currently enabled.
Both bliss_basic and bliss_esrf are supported.

path Parameters
session_name
required
string (Session Name)

Responses

Response samples

Content type
application/json
{
  • "base_path": "string",
  • "beamline": null,
  • "data_path": "string",
  • "root_path": "string",
  • "filename": "string",
  • "template": null,
  • "data_filename": null,
  • "proposal_name": null,
  • "collection_name": null,
  • "dataset_name": null
}

Call a SCAN_SAVING function

Call a function from SCAN_SAVING in session_name

For example create_root_path

path Parameters
session_name
required
string (Session Name)
Request Body schema: application/json
function
required
string (Function)

Responses

Request samples

Content type
application/json
{
  • "function": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Update SCAN_SAVING

Update the SCAN_SAVING settings for session_name

path Parameters
session_name
required
string (Session Name)
Request Body schema: application/json
Template (string) or Template (null) (Template)
Default: null
Data Filename (string) or Data Filename (null) (Data Filename)
Default: null
Proposal Name (string) or Proposal Name (null) (Proposal Name)
Default: null
Collection Name (string) or Collection Name (null) (Collection Name)
Default: null
Dataset Name (string) or Dataset Name (null) (Dataset Name)
Default: null

Responses

Request samples

Content type
application/json
{
  • "template": null,
  • "data_filename": null,
  • "proposal_name": null,
  • "collection_name": null,
  • "dataset_name": null
}

Response samples

Content type
application/json
{
  • "template": null,
  • "data_filename": null,
  • "proposal_name": null,
  • "collection_name": null,
  • "dataset_name": null
}

Call a function in the session

Call a function either directly in session_name or on an object in the session

This allows for example, to execute scans, and interact with bliss objects in the context
of the running session.

function can also be a module path of the form path.to.module.function in order to
dynamically load a function. Future calls will be reloaded with importlib to cache bust.

The endpoint blocks until the function returns and will try to json serialise the response,
if this is not possible an exception will be raised. Calls can also be made asynchornously
by setting call_async true. In this case a call_id will be returned which can be used
to verify the status of the running function.

Exceptions will be caught and returned along with the traceback.

path Parameters
session_name
required
string (Session Name)
Request Body schema: application/json
Call Async (boolean) or Call Async (null) (Call Async)
Default: false

Whether to make the call asynchronously

Retrieve Scanid (boolean) or Retrieve Scanid (null) (Retrieve Scanid)
Default: false

Assume this function returns a Scan, call it with run=False, start scan, and retrieve its scanid

function
required
string (Function)

The function to call, can also be a module/function path

Object (string) or Object (null) (Object)
Default: null

An object on which to call a function

Array of Args (any) or Args (null) (Args)
Default: []

A list of arguments, $ will be interpolated to the corresponding object

Kwargs (object) or Kwargs (null) (Kwargs)
Default: {}

A dictionary of kwargs, $ will be interpolated to the corresponding object

Responses

Request samples

Content type
application/json
{
  • "call_async": false,
  • "retrieve_scanid": false,
  • "function": "string",
  • "object": null,
  • "args": [ ],
  • "kwargs": { }
}

Response samples

Content type
application/json
{
  • "return_value": null,
  • "call_id": null,
  • "scanid": null
}

Get the state and response for an asynchronous call to a function in the session

Get the state and response of an asynchronous function call in the session

Exceptions will be caught and returned along with the traceback.

path Parameters
session_name
required
string (Session Name)
call_id
required
string (Call Id)

Responses

Response samples

Content type
application/json
{
  • "return_value": null,
  • "call_id": null,
  • "scanid": null,
  • "state": "string"
}

Kill an asynchronous call to a function in the session

Kill an asynchronous function call in the session

Exceptions will be caught and returned along with the traceback.

path Parameters
session_name
required
string (Session Name)
call_id
required
string (Call Id)

Responses

Response samples

Content type
application/json
{
  • "error": "string"
}

Hardware

Get a list of hardware objects

Get a list of all hardware statuses

query Parameters
Type (string) or Type (null) (Type)
Default: null

Filter by a specific type

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "results": [
    ],
  • "skip": null,
  • "limit": null
}

Register a series of hardware objects to be made available via the API

Register a series of hardware objects

Request Body schema: application/json
ids
required
Array of strings (Ids)

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
{
  • "ids": [
    ]
}

Get a single hardware object

Get the status of a particular hardware object

path Parameters
id
required
string (Id)

The bliss object id

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "type": "string",
  • "online": true,
  • "errors": [
    ],
  • "name": "string",
  • "alias": null,
  • "callables": [
    ],
  • "properties": { }
}

Update a hardware propery

Update a property on a hardware object

path Parameters
id
required
string (Id)

The bliss object id

Request Body schema: application/json
property
required
string (Property)

The property to set

value
required
any (Value)

Its value

Responses

Request samples

Content type
application/json
{
  • "property": "string",
  • "value": null
}

Response samples

Content type
application/json
{
  • "property": "string",
  • "value": null
}

Call a function on a hardware object

Call a function on a hardware object

path Parameters
id
required
string (Id)

The bliss object id

Request Body schema: application/json
function
required
string (Function)

The function to call

Value (any) or Value (null) (Value)
Default: null

Its value (if any)

Responses

Request samples

Content type
application/json
{
  • "function": "string",
  • "value": null
}

Response samples

Content type
application/json
{
  • "function": "string",
  • "value": null,
  • "response": null
}