[[PageOutline]] 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 == * [wiki:adeiService_list list.php ] - List various aspects of ADEI configuration * [wiki:adeiService_getdata getdata.php ] - Returns the requested data in the specified format (only real data is returned, no aggregation is performed) * [wiki:adeiService_genimage genimage.php ] - Generate image and return image identificator (for future use in getimage.php) along with various image properties. * [wiki:adeiService_getimage getimage.php ] - Returns the specified image (which previously generated with ''genimage'' request) * [wiki:adeiService_legend legend.php ] - Generates list of channels having at the demanded time point the values in the specified range (API is expected to change in the near future and not documented for this reason). * [wiki:adeiService_search search.php ] - Provides searches for the channel names, data values, and custom functionality * [wiki:adeiService_control control.php ] - Control functionality (read and write) * [wiki:adeiService_download download.php ] - Manages user downloads. * [wiki:adeiService_info info.php ] - Various information about ADEI. == Common Parameters == '''Data Source Specification''' * ''db_server'' - Data source (Server Identificator) * ''db_name'' - Database name (within data source) * ''db_group'' - Log Group (Identificator) * ''control_group'' - Control Group, the control groups can be and often are different from the loggroups * ''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 * ''control_mask'' - The comma-separated mask of items within the control group, if mask is not specified all group items are considered '''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) * '''' - specifies window width in seconds, the window is positioned in the end of experiment * ''-'' - 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 * [wiki:adeiParam_time_format time_format] - Specifies the format to return timestamps in, by default the UNIX timestamp (seconds since 1970-01-01) is used (fractal numbers are allowed). == Examples == * To get list of available log groups (data source: ''toskanadb'', databse: ''prespektrometer_rep'') {{{ http://adei_server.net/adei/services/list.php?target=groups&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/getdata.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 }}}