Version 15 (modified by csa, 16 years ago) |
---|
ADEI provides set of interfaces to facilitate access to the configuration and collected data. All interfaces are accessible by means of standard HTTP GET requests. The request parameters are supplied using GET parameters. The response is normally returned using XML or JSON encoding. The getdata and getimage requests return the data or image in the specified format.
Supported Services
Accessing current configuration
- server.php - Returns list of configured data sources
- database.php - Returns list of available databases within data source
- loggroup.php - Returns list of available loggroups within specified database
- mask.php - Returns list of configured masks withing specified loggroup
- item.php - Returns list of available data items (channels) within specified loggroup
- experiment.php - Returns list of experiments
- timewindow.php - Returns list standard window sizes
Access to the export related configuration
- format.php - Returns list of supported export formats
- export_sampling.php - Returns list of supported sampling rates (optional, for data export)
- export_window.php - Returns list of supported export modes (interval)
- Selection
- Currently opened data window
- Whole experiment
- export_mask.php - Returns list of supported export modes (item mask)
- Current group only
- All groups having the mask with specified name
- Complete data source
- Everything
Access to the data aggregation related configuration (image generation)
- aggregation.php - Returns list of supported data aggregation modes (MEAN, MMAX, ...)
- interpolate.php - Returns list of current interpolation modes
- show_gaps.php - Returns list of available modes for reporting missing data
- show_marks.php - Returns list of available modes for reporting positions of real data points
Data requests
- getdata.php - Returns the requested data in the specified format (only real data is returned, no aggregation is performed)
- genimage.php - Generate image and return image identificator (for future use in getimage.php) along with various image properties.
- getimage.php - Returns the specified image (which previously generated with genimage request)
Supported Parameters
Data Source Specification
- db_server - Data source (Server Identificator)
- db_name - Database name (within data source)
- db_group - Log Group (Identificator)
- db_mask - Item mask, possible values are:
- mask name
- comma separated list of items (numeric, counted from zero)
- omit this parameter to select all log group items
Data Interval Specification
- experiment - The current experiment duration
- 0 - specifies experiment covering all available data
- from-to - specifies experiment start and end timestamps (unix timestamp, seconds since January 1, 1970)
- window - data window within current experiment
- 0 - use maximal width (window is covering complete experiment duration)
- <number> - specifies window width in seconds, the window is positioned in the end of experiment
- <from>-<to> - specifies the window start and the end (as unix timestamps). The real numbers should be used to get subsecond precision.
Export Specification
- format - desired data format
- resample - desired sampling rate (optional)
- filename - desired file name (optional)
- mask_mode - should be specified if multiple groups are requested
Data aggregation parameters
- aggregator - data aggregation mode
- show_marks - real-data-points reporting mode
- show_gaps - missing-data reporting mode
- interpolate_gaps - data interpolation mode
- precision - specifies required chart precision
Chart generation parameters
- frame_width - image width
- frame_height - image height
Various
- id - image id in getimage request
Examples
- To get list of available log groups (data source: toskanadb, databse: prespektrometer_rep)
http://adei_server.net/adei/services/database.php?db_server=toskanadb&db_name=prespektrometer_rep
- To get in CSV format all data channels from first loggroup for a period starting at May 19, 2008 and finishing at May 20, 2008
http://adei_server.net/adei/services/database.php?db_server=toskanadb&db_name=prespektrometer_rep&db_group=0&experiment=0&window=1211159859-1211241600&format=csv
- To generate an 1280x1024 image with composite graph of all channels from first loggroup for a period starting at May 19, 2008 and finishing at May 20, 2008
http://adei_server.net/adei/services/getimage.php?db_server=toskanadb&db_name=prespektrometer_rep&db_group=0&experiment=0&window=1211159859-1211241600&frame_width=1280&frame_height=1024
- Few additional properties could be used to hint drawer about produced image properties. In the next example, the MINMAX approach is used to aggregate data, the positions of actually drawn points are highlighted and high precision mode is used (could take a lot of time).
http://adei_server.net/adei/services/getimage.php?db_server=toskanadb&db_name=prespektrometer_rep&db_group=0&experiment=0&window=1211159859-1211241600&frame_width=1280&frame_height=1024&aggregation=MINMAX&show_gaps=POINTS&precision=HIGH
- If information on generated image is required, then two step approach could be used. The genimage request is used to generate an image.
http://adei_server.net/adei/services/genimage.php?db_server=toskanadb&db_name=prespektrometer_rep&db_group=0&experiment=0&window=1211159859-1211241600&frame_width=1280&frame_height=1024
In a response you will get JSON encoded document with various image properties. If an error was occurred, the JSON document will contain only error property, which describes the problem. Otherwise, among other properties the 'image' property containing image identificator will be returned. Then it is possible pass this idetificator to getimage service in order to obtain image.http://adei_server.net/adei/services/getimage.php?id=clients/00000000000000000000000000000000/draw.toskanadb__prespektrometer_rep__0/eda6ebefe6e066c87af7c3af423f195e/1216378894_1211159859_81741.png