API Calls Reference

This section contains the main HTTP commands available to DAQBroker client. These commands are used in the javascript functions and can also be used for other third-party client applications to interact with a machine running the DAQBroker server application

General purpose actions

This section contains general purpose requests

Resource Operation Description
Create links POST /daqbroker/genLink Generate a shareable link
Get DAQBroker processes POST /daqbroker/checkProcesses Get currently working DAQBroker subprocesses
Get DAQBroker settings POST /daqbroker/discoverSettings Get global DAQBroker settings
Get backup files POST /daqbroker/multipleFileDownload Get a specific file from a directory in the DAQBroker backup directory
  GET /daqbroker/downloads/(path:filename)  
  GET /daqbroker/temp/(path:filename)  
Get current user POST /daqbroker/getCurrentUser Get currently logged in user in the current used server
Get database servers POST /daqbroker/getLocalServers Get list of database servers to which the machine has made contact
Get link info POST /daqbroker/getLink Get shared info from provided link
Get logged events POST /daqbroker/getLog Get logged events within time frame
Get/Set collection POST /daqbroker/collections Get/Set data channel collections
List available client binaries POST /daqbroker/serveDists Get list provided DAQBroker client application binaries
List databases POST /daqbroker/checkDatabases List server DAQBroker databases
Test administrator credentials POST /daqbroker/queryAdmin Test a connected user for administrator privileges
Test expression POST /daqbroker/checkExpression Test validity of expression
POST /daqbroker/multipleFileDownload

Request to access multiple files in the backup directory

POST /daqbroker/discoverSettings

Check whether a global settings database exists on supplied database server

Returns:

JSON encoded list of session server objects with the following keys:

currentServer : (String) server address
currentEngine : (String) server database SQL engine
settingsExist : (Boolean) global settings database exists. Should only return False if a user has logged in for the first time to the engine
monActive : (Boolean) returns True if a server monitoring process is currently underway
POST /daqbroker/checkExpression

Evaluate the validity of a data manipulation expression

Param:expression: (String) A string containing properly formatted python code; limitations exist. Refer to PLACEHOLDER for data manipulation options
Returns:JSON encoded list of unique channel identifiers
POST /daqbroker/getLocalServers

Get a list of all available database servers to which users have already connected to

POST /daqbroker/checkProcesses

Request to check the status of existing database processes. This list of processes is stored in memory. Should be used in conjunction with actProcess

Returns:

JSON encoded string containing a list of working DAQBroker subprocesses. Each element of that list will be an object containing the following keys:

name : Name of the process
pid : PID of the process on the server machine
description : Small description of the purpose of the process
POST /daqbroker/getCurrentUser

Request the current user and its type

Returns:

JSON encoded string of currently connected server:

username : Name of the user
type : type of user
POST /daqbroker/checkDatabases

Get a list of existing DAQBRoker databases in a supplied database engine

Returns:

JSON list of database objects. A database object has the following attributes

dbname : (String) name of the database
active : (Boolean) database flagged for instrument monitoring
POST /daqbroker/collections

Get or set the available data channel collections

:param Placeholder : Placeholder parameter, not implemented, will be used create new collections

Returns:

If no parameter is supplied, a list of existing collections is presented. Each collection consists of an object with the following keys:

Name : string containing the address of the NTP server
channels : JSON encoded string containing the channel ID of each channel in the collection
remarks : further remarks regarding the collection (unused)
POST /daqbroker/queryAdmin

Test if the current loged user to the database and engine has DAQBroker administrator privileges

Returns:

JSON encoded user object

username : (String) unique user name
type : (Integer) type of user. See PLACEOHOLDER for available types
POST /daqbroker/serveDists

Provides list of DAQBroker client application binary distributions - used for browser download

Returns:JSON encoded directory structure of the “dists” folder
POST /daqbroker/genLink

Create a shareable link of a supplied interface state

Param:site : (String) endpoint name
Param:var : (String) JSON encoded state variable
Returns:(String ) unique shareable link
POST /daqbroker/getLink

Get the entry associated with a supplied shareable link

Param:

link : (String) unique link

Returns:

Logical false if no link was found or timed out. JSON encoded link object with the following keys:

site : (String) endpoint name
variable : (String) JSON encoded state variable
POST /daqbroker/getLog

Get the entries of logged events between a specific time interval.

Param:timeLogStart: (Integer) start timestamp
Param:timeLogEnd: (Integer) end timestamp
Returns:List of event entries (strings) inside the requested time interval
GET /daqbroker/downloads/(path: filename)

Request to access specific files in the backup directory

GET /daqbroker/temp/(path: filename)

Request to access specific files in the backup directory

Instrument actions

This section contains requests that interact with instruments

Resource Operation Description
Add virtual log entry POST /instruments/insertLogComment Add an entry to an instrument’s virtual log
All Instrument Details POST /instruments/queryInstrumentsFull Get full information from all database instruments
Alter instrument’s user POST /instruments/changeInstOp Alter an instrument’s operator user
Basic Instrument Details POST /instruments/queryInstruments Get basic information from all database instruments
Create/Edit instrument POST /instruments/insertInstrument Creates or edits a DAQBroker instrument instrument
Delete data channel POST /instruments/deleteChannel Deletes an instrument data channel and its data
Delete instrument POST /instruments/deleteInstrument Deletes an instrument and its data
Edit data source POST /instruments/editParsing Edit data source action information
Edit virtual log POST /instruments/editLogEntry Edit entry of an instrument’s virtual log
Get instrument files POST /instruments/listInstFiles Get instrument’s stored data files
Get time limits POST /instruments/getInstLimits Get database largest and shortest stored timestamp
Instrument Details POST /instruments/queryInstDetails Get Full information from single instrument
Test credentials POST /instruments/queryInstCreds Test current credentials for instrument editing
Toggle active state POST /instruments/setActiveInstrument Toggles an instrument on or off to be monitored
POST /instruments/queryInstrumentsFull

List of full instrument information in supplied database and engine

Returns:A JSON encoded list of basic instrument information. see queryInstDetails() for single object

description

POST /instruments/setActiveInstrument

Toggles the current active monitoring state of an instrument

Param:instid : (Integer) unique instrument identifier. Used to edit an existing instrument
Returns:(Boolean) The resulting new monitoring state of the instrument
POST /instruments/queryInstruments

List basic instrument information in supplied database and engine

Returns:A JSON encoded list containing basic information of each instrument in a database as an object with the

following keys :

Name : String the unique name of the instrument
instid : Integer containing a unique identifier of the instrument
active : Boolean containing the monitoring state of the instrument
description : String containing a description of the instrument, if supplied
username : String containing the username associated with the instrument
email : String containing the contact information (email, phone) of the person responsible of the

instrument, if supplied | insttype : Integer containing the type of instrument (unused) | log : JSON encoded string of entries in a virtual instrument log book

POST /instruments/queryInstDetails

Get full instrument information on a specified instrument from a specified database

Param:

instid : (Integer) unique instrument identifier

Returns:

A JSON encoded object with full instrument information

Name : String the unique name of the instrument
instid : Integer containing a unique identifier of the instrument
active : Boolean containing the monitoring state of the instrument
description : String containing a description of the instrument, if supplied
username : String containing the username associated with the instrument
email : String containing the contact information (email, phone) of the person responsible of the

instrument, if supplied | insttype : Integer containing the type of instrument (unused) | log : JSON encoded string of entries in a virtual instrument log book | files : List of instrument data source objects and their status:

clock : (Integer) timestamp of the last edit to the source information
name : (String) name of the data source
metaid : (Integer) unique instrument data source identifier
instid : (Integer) unique instrument identifier
type : (Integer) type of data source :
0 : file(s)
1 : serial port
2 : network port
3 : user-supplied file
node : (String) unique ID of a machine running a DAQBroker client
remarks : (String) JSON encoded object with information of the data source
sentRequest : (Boolean) request is being processed by a client machine
lastAction : (Integer) timestamp of last automated monitoring action on source
lasterrortime : (Integer) last timestamp of error collection (unused)
lasterror : (String) last collected error (unused)
lockSync : (Boolean) data source is set to not backup data
channels : (List) objects containing definition of a data source’s individual data channels:
Name : (String) data channel name
channelid : (Integer) unique channel identifier
channeltype : (Integer) channel type
0 : Number
1 : Text
2 : Custom
valuetype : (Integer) NASA processing level
units : (String) physical units
instid : (Integer) unique instrument identifier
description : (String) channel description
active : (Boolean) accessible for all users
remarks : (String) JSON encoded extra information
metaid : (Integer) unique instrument data source identifier
lastclock : (Integer) latest stored timestamp
lastValue : (Double) value at latest stored timestamp
fileorder : (Integer) order on file (used for source type 0)
alias : (String) original name (kept when channel name changes)
firstClock : (Integer) lowest stored timestamp
parsing : (List) objects containing definition of a source’s status of data collection. Each object contains the following keys
clock : (Integer) entry creation timestamp
lastAction : (Integer) latest action timestamp
metaid : (Integer) unique instrument data source identifier
instid : (Integer) unique instrument identifier
type : (Integer) same as files - type
locked : (Boolean) automated parsing underway
forcelock : (Boolean) parsing locked by user
remarks : (Integer) extra information
POST /instruments/deleteInstrument

Delete an instrument and its data. Only instrument owners and instrument administrators are allowed to delete instruments

Param:instid: (Integer) unique instrument identifier
POST /instruments/insertInstrument

Insert a new instrument or edit an existing instrument on a DAQBroker database. Guest users are not allowed to create instruments. Created instruments are

Param:

Name : (String) unique instrument name

Param:

instid : (Integer) unique instrument identifier. Used to edit an existing instrument

Param:

description : (String) description of the instrument and its

Param:

email : (String) contact information for the instrument operator

Param:

Files : (Optional) JSON encoded list of instrument data source objects. Each Contains the following keys:

name : (String) name of the data source
metaid : (Integer) unique data source identifier. Only used to edit existing data sources
type : (Integer) type of instrument data source
node : (String) unique network node identifier
remarks : (String) JSON encoded object of extra data source information
channels : (Optional) JSON encoded list of data channel objects. Each contains the following keys:
Name : (String) data channel name
channelid : (Integer) unique channel identifier. -1 if the channel is new. Positive integer

if the channel already exists | description : (String) data channel description | units : (String) data channel physical units | channeltype : (Integer) type of data channel

0 : Number
1 : Text
2 : Custom
active : (Boolean) channel is shown on interface
fileorder : (Integer) Used to order channels in a data source
alias : (String) Original data channel name. Kept constant when name changes
remarks : (String) JSON encoded object with extra information
oldname : (String) Old channel name. Used to detect changes in the channel name
channeltypeOld : (Integer) Old channel type. Used to detect changes in the channel type
POST /instruments/insertLogComment

Add an entry into an instrument’s virtual log book

Param:

instid: (integer) unique instrument identifier

Param:

entry: object containing the following keys:

date : (Integer) New entry timestamp (if same as oldDAte date doesn’t change)
author : (String) Entry author
entry : (String) Entry text
POST /instruments/queryInstCreds

Check if the provided credentials allow an instrument to be edited. Only the instrument creator and the system administrators can edit instruments

Param:

instid: (Integer) unique instrument identifier

Returns:

A JSON encoded object with credential test results

username : (String) current username
type : (Integer) user type see PLACEHOLDER FOR AVAILABLE TYPES
error : (Boolean) if instrument belongs to user or not
POST /instruments/deleteChannel

Delete an instrument’s data channel along with its data. Only instrument owners and system administrators can delete data channels

Param:channelid: (Integer) unique instrument data channel identifier
POST /instruments/getInstLimits

Get largest and smallest stored time stamps

Returns:

JSON encoded object with the following keys:

max : (Integer) largest timestamp
min : (Integer) smallest timestamp
POST /instruments/listInstFiles

Request to list an instrument’s current data file structure

Parameters:
  • instName – Name of the requested instrument
Returns:

JSON encoded string containing the collected file structure of the requested instrument.

POST /instruments/editLogEntry

Edit an entry from an instrument virtual log book

Param:

instid: (integer) unique instrument identifier

Param:

entry: object containing the following keys:

oldDate : (Integer) original entry timestamp
date : (Integer) New entry timestamp (if same as oldDAte date doesn’t change)
author : (String) Entry author
entry : (String) Entry text
Param:

operation: (string) operation to be preformed in entry

edit : Edit entry
remove : Remove entry
POST /instruments/changeInstOp

Alter an existing instrument’s operator. This action can only be preformed by a system administrator

Param:newUsername : (String) new instrument username
Param:instid : (Integer) unique instrument identifier
POST /instruments/editParsing

Edit the existing parsing information of an instrument

Param:

instid: (integer) unique instrument identifier

Param:

metaid: (integer) unique instrument data source identifier

Param:

sourceResetTime: (integer) number of seconds to reset the parsing information

Param:

operation: (string) operation to be preformed

remove : Remove data source and associated data
reset : Reset processing information
lockP : Toggle lock data storage methods
lockB : Toggle lock file backup methods

Data actions

This section contains requests that collect data from instruments

Resource Operation Description
Abort job POST /data/getDataAbort Abort generic job
  GET /data/getDataAbort  
Abort jobs POST /data/getDataAbortStream Abort running data collection jobs
Abort single job POST /data/getDataAbortStreamRequest Abort single running data collection jobs
Collect job data POST /data/getDataCheckStream Collect data or running info from data collection jobs
Create data collection jobs POST /data/getDataStream Create a set of possibly long running data collection jobs
Create/Edit visualizations POST /data/saveVisualization Create or edit a visualization or a set of visualizations
Gata job data POST /data/getDataCheck Get data from a generic job
Get channel data POST /data/getData Get data from specified channel
Get expression data POST /data/getExpressionTrace Get data from specified expression
Get layout list POST /data/getLayouts Get a list of saved sets of data visualizations
Get plot comments POST /data/getPlotComments Get list of comments associated with plot
Get visualization list POST /data/getPlots Get a list of saved data visualizations
POST /data/getDataAbortStreamRequest

Abort a single job. See ‘getDataStream’ for more information on generating a list jobs

Param:jobs : JSON encoded list of unique job identifiers
POST /data/getDataCheckStream

Get the data from provided list of existing jobs. See :py:meth:getDataStream for more information on generating a list jobs. Job results are stored in memory and the local database contains a reference to the memory position of that data if the job completed successfully

Param:

jobs : JSON encoded list of job objects, containing the following keys:

id : (String) unique job identifier
Returns:

A job result object containing the following keys

id : (String) unique job identifier
type : (String) job type. See :py:meth:getDataStream for more information
data : (String) JSON encoded object of information data about the requested job
status : (integer) Status of the requested job
0 : Job underway
1 : Job finished, no errors
-1 : Job finished, with errors
POST /data/getDataAbortStream

Abort a set of supplied jobs. See ‘getDataStream’ for more information on generating a list jobs. This request interrupts ongoing jobs, deletes local database records and deletes data in memory

Param:jobs : JSON encoded list of unique job identifiers
POST /data/getExpressionTrace

Collect manipulated data from a supplied expression. The request can be asynchronous returning an ongoing job or sequential returning the full processed data. This request is tested with the flask is_xhr flag (DEPRECATED, NEED TO IMPROVE) to decide if the request is created as a long running job or a concurrent one. This test should decide if the request is being made from a command line or third-party program or if it is sent via an interface

Param:

startTime : (Integer) start timestamp

Param:

endTime :(Integer) end timestamp

Param:

screenSize : (Integer) size of display in pixels (used to decrease query load)

Param:

fullResolution : (Boolean) if true, get all data regardless of screenSize value

Param:

expression : (Integer) unique data channel identifier

Returns:

JSON encoded object with the requested data if is_xhr=False:

type : type of data request. Should default to “expression”
data : List of 2 element lists of [timestamp, value] inside the requested time range [startTime,**endTime**]

JSON encoded job object if is_xhr=True:

id : (String) unique job identifier
type : (String) type of request. Should default to “expression”
data : Single channel data
expression : Data from expression
POST /data/saveVisualization

Save a data visualization or a set of data visualizations

Param:

visionType : (Integer) Type of visualization

0 : Single data visualization
1 : Set of visualizations (layout)
Param:

plotid : (Integer) unique identifier visualization. Used to edit visualizations. Only used if visionType=0

Param:

plotname : (String) unique visualization name. Only used if visionType=0

Param:

plottype : (Integer) creation timestamp. See :py:meth:getLayouts for types. Only used if visionType=0

Param:

channelids : (String) JSON encoded list of data channels used. Only used if visionType=0

Param:

remarks : (String) JSON encoded object of extra plottype information. Only used if visionType=0

Param:

layoutid : (Integer) unique identifier of created layout. Used to edit layouts. Only used if visionType=1

Param:

layoutname : (String) unique layout name. Only used if visionType=1

Param:

plots : (String) JSON encoded list of unique plot identifiers on layout. Only used if visionType=1

Param:

format : (String) JSON encoded object of layout information. Only used if visionType=1

Returns:

If visionType=0 returns the unique identifier of the added or altered visualization. IOf visionType=1 returns the unique identifier of added or altered layout

POST /data/getPlotComments

Retrieve a list of comments associated with an existing data visualization

Param:

plotid : (Integer) unique plot identifier

Param:

chanelid : (Integer - optional) unique channel identifier

Returns:

JSON encoded list of comment objects associated with the provided visualization. If the optional channelid parameter is provided, the search is limited to visualization comments specific to one data channel. A comment object contains the following keys:

clock : (Integer) comment timestamp
plotid : (Integer) unique visualization identifier
channelid : (Integer) unique channel identifier
comment : (String) comment
author : (String) comment author
remarks : (String) extra information (unused)
POST /data/getDataStream

Start data collection job of a list of data channels

Param:

reqID : (String) Uniquely generated ID string to identify the requested jobs

Param:

jobRequests : JSON encoded list of request objects with the following keys:

startTime : (Integer) start timestamp
endTime : (Integer) end timestamp
type : (String) type of request
data : Single channel data
expression : Data from expression
screenSize : (Integer) size of display in pixels (used to decrease query load)
fullResolution : (Boolean) if true, get all data regardless of screenSize value
channelid : (Integer) unique data channel identifier (only used if type="data")
expression : (String) data manipulation expression (only used if type="expression")
expressionName : (String) expression name (only used if type="expression")
expressionIdx : (String) expression index in list of expressions (only used if type="expression")
Returns:

A JSON encoded list of an ongoing job objects with the following keys:

id : (String) unique job identifier
channelid : (Integer) unique channel identifier only returned if (only used if type="data")
name : (String) same as expressionName only returned if (only used if type="expression")
idx : (String) same as expressionIdx only returned if (only used if type="expression")
POST /data/getDataCheck

Auxiliary request used to check collect generic information from a job

Parameters:
  • id – (String) unique job identifier
Returns:

(String) JSON encoded string of the requested job’s information, check getDataCheckStream() to get a reference of the returned object

POST /data/getDataAbort

Auxiliary request used to check abort a generic job

Parameters:
  • id – (String) unique job identifier
GET /data/getDataAbort

Auxiliary request used to check abort a generic job

Parameters:
  • id – (String) unique job identifier
POST /data/getLayouts

Get a list of saved sets of data visualizations

Returns:

A JSON encoded list of sets of visualizations, called layouts. Each layout object contains the following keys:

Name : (String) unique layout name
layoutid : (Integer) unique layout identifier
plots : (String) JSON encoded list of visualization identifiers
format : (String) JSON encoded format of layout
POST /data/getPlots

Get a list of saved data visualizations

Returns:

A JSON encoded list of visualizations. Each object contains the following keys:

plotname : (String) unique visualization name
plotid : (Integer) unique visualization identifier
channelids : (String) JSON encoded list of data channel identifiers
plottype : (Integer) type of plot
0 : Time series
1 : Time evolving historgram
2 : Histogram
3 : External
adminPlot : (Boolean) plot created by admin (unused)
active : (Boolean) active flag (unused)
remarks : (String) extra information for each plottype
POST /data/getData

Get data from a supplied data channel. The request can be asynchronous, returning a job or it can be sequential, returning the requested data. This request is tested with the flask is_xhr flag (DEPRECATED, NEED TO IMPROVE) to decide if the request is created as a long running job or a concurrent one. This test should decide if the request is being made from a command line or third-party program or if it is sent via an interface

Param:

startTime : (Integer) start timestamp

Param:

endTime :(Integer) end timestamp

Param:

screenSize : (Integer) size of display in pixels (used to decrease query load)

Param:

fullResolution : (Boolean) if true, get all data regardless of screenSize value

Param:

channelid : (Integer) unique data channel identifier

Returns:

JSON encoded object with the requested data if is_xhr=False:

type : (String) type of data requested, should default to “data”
closestClockDown : (Ineger) closest time stamp to startTime , used for interpolation needs in case of empty ranges
closestClockUp : (Ineger) closest time stamp to endTime , used for interpolation needs in case of empty ranges
closestValueDown : (Double or String) closest time stamp to startTime , used for interpolation needs in case of empty ranges
closestValueUp : (Double or String) closest time stamp to endTime , used for interpolation needs in case of empty ranges
min : (Double or String) minimum value in range
max : (Double or String) maximum value in range
mean : (Double or String) mean of data range (only works on number channels)
std : (Double or String) standard deviation of data range
minTime : (Double) minimum timestamp in range
maxTime : (Double) maximum timestamp in range
minTimeStep : (Double) minimum interval between timestamps in range
maxTimeStep : (Double) maximum interval between timestamps in range
meanTime : (Double) mean interval between timestamps in range
stdTime : (Double) standard deviation between timestamps in range (broken)
name : (String) data channel name
iname : (String) channel instrument name
channelID : (Integer) Unique channel identifier
channeltype : (Integer) same as type
remarks : (String) JSON encoded object with extra information
metaid : (Integer) Unique data source identifier
query : (String) SQL query used to collect the data
data : List 2 element lists of [timestamp, value] inside the requested time range [startTime,**endTime**]

JSON encoded job object if is_xhr=True:

id : (String) unique job identifier
type : (String) type of request. Should default to “data” in this request
data : Single channel data
expression : Data from expression

Experimental run actions

This section contains requests that interact with the experimental run lists

Resource Operation Description
Create/Edit run list POST /runs/submitRunlistData Create or edit the experimental run list layout
Get most recent run list layout POST /runs/getRunListInfo Get most recent run list layout information
Get run list POST /runs/getRunList Get list of experimental runs
Insert run POST /runs/insertRun Insert experimental run
POST /runs/submitRunlistData

Create/edit experimental run list layout. Insert/edit experimental parameters and parameter types. This request must send its parameters as a single JSON encoded string and the content-type header must be supplied as application/json

Param:

isNewRunlist : (Boolean) if runlist is new

Param:

clock : (Integer) creation timestamp

Param:

runlistType : (Integer) Run list type (unused)

Param:

runlistRemarks : Object containing global runlist information. Contains the following keys:

cols : List of experimental parameter objects. Experimental parameter objects contain the following keys:
name : (String) name of the parameter
type : (Integer) type of parameter
0 : Regular parameter
3 : Run Title identifier (optinal declaration)
4 : Option parameter
parType : (Integer - optional) Type of regular parameter (only used if type=1)
0 : Number
1 : Text
parUnits : (Integer - optional) Physical parameter units (only used if type=1)
parOptions : (String - optional) JSON encoded string of parameter options (only used if type=1)
action : (String) Action to be preformed on parameter
add : add parameter
edit : edit parameter
delete : delete parameter
POST /runs/getRunListInfo

Get relevant information about the existing experimental run list and its parameters

Returns:

A JSON encoded object representing a run list layout. Contains the following keys:

clock : (Integer) creation timestamp
lastUpdate : (Integer) last update timestamp
isLinked : (Boolean) to link with Google Spreadsheets (unused)
linkRemarks : (String) Google Spreadsheets link information (unused)
linkType : (Integer) Google Spreadsheets link type (unused)
runlistRemarks : List of experimental parameter objects see :py:meth:submitRunlistData for description of object
POST /runs/getRunList

Get a list of experimental run entries

Returns:

A JSON encoded list with run objects. Use :py:meth:getRunListInfo to access the individual run parameters. The following keys are always present in each run object:

start : (Integer) run start timestamp
end : (Integer) run end timestamp
run : (String) run defined encoded in the “run.stage” encoding (run 101 stage 2 is encoded “101.02”)
comments : (String) JSON encoded list of run comment objects see :py:meth:insertRun for definition of this object
POST /runs/insertRun

Insert/edit experimental run entries in the supplied DAQBroker database

Param:

rows : List of run objects. A run object has the following information

action : (String) action to be preformed on the run
addActive : Create a new run and set to active status
delete : Delete run
inactive : Change a run to inactive status
change : Edit a run
addComment : Add a run comment
run : Object containing the run parameters and information. Use :py:meth:getRunListInfo to access each individual parameter. The exra run information, common to every database is the following
run : (String) run defined encoded in the “run.stage” encoding (run 101 stage 2 is encoded “101.02”)
comments : (String) list of comment objects specific to a run. A common object contains the following attributes:
author : (String) comment author name
time : (Integer) timestamp of comment
comment : (String) the comment
author : (String - optional) comment author (to send only if action=``addComment``)
date : (Integer - optional) comment timestamp(to send only if action=``addComment``)
comment : (String - optional) comment (to send only if action=``addComment``)
action : Action to be preformed on the run

Network actions

This section contains requests that interact with the server’s network nodes

Resource Operation Description
  POST /monitoring/daqbroker/gatherNodeData  
  GET /monitoring/daqbroker/gatherNodeData  
Get node list POST /monitoring/queryNodes Get list of active remote DAQBroker clients
Get nodes to setup POST /monitoring/getNodes List local nodes still to setup
Setup client node POST /monitoring/testNode Setup a DAQBroker client network node
Toggle node synchronization POST /monitoring/toggleNodeSync Toggle node software synchronization flag
POST /monitoring/daqbroker/gatherNodeData

Gathers general purpose information from a supplied node

Parameters:
  • type

    (Integer) type of request

    1 : Network port data request
    2 : Serial port data request
  • order

    (String) type of request. Required when type=2

    getPorts : Get serial port list
    getPortData : Get data from specific port
  • remarks – (string) JSON encoded string with relevant extra information. Required when type=2 and order=’getPortData’
GET /monitoring/daqbroker/gatherNodeData

Gathers general purpose information from a supplied node

Parameters:
  • type

    (Integer) type of request

    1 : Network port data request
    2 : Serial port data request
  • order

    (String) type of request. Required when type=2

    getPorts : Get serial port list
    getPortData : Get data from specific port
  • remarks – (string) JSON encoded string with relevant extra information. Required when type=2 and order=’getPortData’
POST /monitoring/toggleNodeSync

Toggles the node’s automated software time synchronization routine. If turned on, the server will provide a node with a specific time server to issue synchronization requests

Param:nodeName : (String) Unique node identifier
POST /monitoring/queryNodes

Get the list of local active network DAQBroker clients

Param:

nodeName : (String) unique identifier sting of a node

Returns:

JSON encoded object of requested node if nodeName is specified. List of existing nodes if not. A node is an object with the following attributes

node : (String) unique node identifier
name : (String) visible name of node
address : (String) network address as seen from the server application
port : (Integer) remote communications port
active : (Boolean) flagged for monitoring
lastActive : (Integer) last activity timestamp
tsyncauto : (Boolean) flagged for software synchronization
remarks : (String) Extra health information
POST /monitoring/testNode

Attempt to contact a DAQBroker client machine, validate its sharing link and adding the node to the monitoring link

Param:id: (String) unique node identifier
Param:shareStr: (String) share string generated by the client application
POST /monitoring/getNodes

Get a list of existing local area DAQBroker clients not connected to the machine

Returns:

List of node objects that require connection to the machine

id : (String) unique node identifier
node : (String) visible name of node
address : (String) network address as seen from the server application
serverAddr : (String) server application address as seen from the node
port : (Integer) remote communications port
details : (String) Extra health information

Administrator actions

This section contains requests that preform administrative tasks

Resource Operation Description
Act on DAQBroker processes POST /admin/actProcess Preform actions on available DAQBroker processes
Create databases POST /admin/createDatabase Create a new DAQBroker databases
Create global settings POST /admin/setupSettings create global DAQBroker settings database
Create/Edit user account POST /admin/submitUserData Create or edit a DAQBroker user account
Delete database POST /admin/deleteDatabase Deletes a DAQBroker database
Delete user POST /admin/deleteUser Delete a DAQBroker user
Get local settings POST /admin/queryGlobals Get local server settings
Get/Set NTP servers POST /admin/checkNTPServers Get/Set NTP servers
Get/Set folders POST /admin/checkFolders Get/Set usable server folders
Get/Set ports POST /admin/setPorts Get/Set DAQBroker network ports
List users POST /admin/checkUsers List of server DAQBroker users
  POST /admin/queryUsers  
Toggle database status POST /admin/toggleDatabase Toggle DAQBroker database monitoring status
Toggle server monitoring process POST /admin/toggleMonitoring Toggle server monitoring process
POST /admin/toggleMonitoring

Toggle the database monitoring loop of a supplied DAQBroker database. See PLACEHOLDER for more information about the server monitoring process

POST /admin/checkNTPServers

Set or get the NTP servers used for software synchronization by DAQBroker

Parameters:
  • addServer – string containing the address of the NTP server to add/update to the list of available servers
  • setServer – string containing the address of the NTP server to set as the synchronization server
  • port – Integer containing the port of the NTP server
Returns:

If addServer and setServer are not provided, returns a JSON encoded string of a list of available NTP servers. Each object in the list contains the following keys:

address : string containing the address of the NTP server
port : integer containing the NTP network port
POST /admin/submitUserData

Create/Edit a DAQBroker user account. Only system administrators are allowed to create new users.

Param:

newUser : (Boolean) Tests to insert or edit an existing user

Param:

newName : (String) New username to change/add

Param:

oldName : (String) Old username. To use with True newUser

Param:

userType : (Integer) User type to change/add

0 : Adminstrator
1 : Operator
2 : User
3 : Guest
Param:

newPassword : (String) User password to change/add

POST /admin/createDatabase

Create a new DAQBroker database

Param:newName : (String) new database name
POST /admin/deleteDatabase

Delete an existing DAQBroker database in the supplied database engine

Param:dbname : (String) database name
POST /admin/toggleDatabase

Toggle the active state of an existing DAQBroker database. When active, databases will have their instruments monitored for new data.

Param:dbname : (String) database name
POST /admin/setupSettings

Create a global settings DAQBroker database on a supplied database server

POST /admin/queryGlobals

Query local machine storage for settings

Returns:

JSON encoded string containing local machine settings. This is an object with the following keys:

clock : Timestamp of last alteration to settings
version : Version of the server application being used
backupfolder : Backup folder
importfolder : Imports folder
tempfolder : Temporary file folder
ntp : NTP server used for software synchronization
logport : Network port for logging server
commport : Network port for communication
remarks : JSON encoded string containing machine health information
POST /admin/checkFolders

Get or set the folders available to use as backup, import or temporary folder

Parameters:
  • addFolder – String containing the folder to be added to the list of available folders
  • setFolder – String containing the folder to be set as a specific type of folder
  • (optional) (folderChange) – An integer defining the path to be set. Can be set to 0 (backup), 1 (import) or 2 (temp). If not supplied, no folder is changed
Returns:

If folderChange and addFolder are not provided, returns a JSON encoded string of a list of available folders. Each object in the list contains the following keys:

path : string containing the address of the NTP server
POST /admin/actProcess

Request to start or stop database monitoring processes

Parameters:
  • procName

    (String) DAQBroker subprocess to be acted on

    Backup : Backup server process
    Logger : Event logging process
    Collector : Communication process
    Producer : Database monitoring process
  • action

    (String) action to be preformed on procName

    add : Start (if not already)
    remove : Stop (if not already)
Returns:

JSON string containing the following keys:

alive : Boolean value defining whether the process is alive or not
name : Name of the process, same as procName
POST /admin/checkUsers

Get a list of available DAQBroker users

Returns:

JSON list of user objects. A user object has the following attributes

username : (String) user name
type : (String) type of user. Visit PLACEHOLDER for definition of user types
POST /admin/queryUsers

Get a list of available DAQBroker users

Returns:

JSON list of user objects. A user object has the following attributes

username : (String) user name
type : (String) type of user. Visit PLACEHOLDER for definition of user types
POST /admin/deleteUser

Delete an existing DAQBroker user

Param:userToDelete : (String) Name of user to delete
POST /admin/setPorts

Request to alter DAQBroker’s network ports

Parameters:
  • commport – Integer containing the requested port of the communications port
  • logport – Integer containing the requested port of the log port