User Tools

Site Tools


dev:app_store_data_requests

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:app_store_data_requests [2017/08/01 11:55] sudev:app_store_data_requests [2021/06/07 14:51] (current) su
Line 1: Line 1:
-**GET Gestalt/api/data/values/{dsn}?tag=tagname1&function={function}&start={start}&end={end}&points={points}&step={step} +====== Data Requests ======
-**+
  
-For //function// field supported values vary from driver to driver, but it's safe to assume that the following values will be supported:+Data requests are executed via the Data Core API. 
 + 
 +Support actions include... 
 + 
 +==== Get Data Sources ==== 
 + 
 +Returns available data sources user. 
 + 
 +Endpoints: 
 + 
 +  * [[https://appstore.intelligentplant.com/ApiHelp/Api/GET-Gestalt-api-data-datasources_filter|GET https://appstore.intelligentplant.com/gestalt/datacore/api/data/datasources]] 
 + 
 +==== Get Tags ==== 
 + 
 +Performs a tag search on a data source for the specified filter. 
 + 
 +Endpoints:  
 + 
 + 
 +== Get Snapshot == 
 + 
 +Performs a snapshot (i.e. "what is the value now?") data query on a data source for a specified tag. 
 + 
 +== Get Processed Data == 
 + 
 +Performs a processed (or aggregated) data query (e.g. Max, Min, Avg) on a data source for a specified tag and date range. 
 + 
 +Aggregation Function:
  
-  * **RAW** - for raw historical data 
-  * **NOW** - for the current snapshot value 
   * **INTERP** - for interpolated data   * **INTERP** - for interpolated data
-  * **PLOT** - a display-friendly aggregation for when you want to display a trend on the screen 
   * **MIN** - minimum value calculated at each sample interval over a time range   * **MIN** - minimum value calculated at each sample interval over a time range
   * **MAX** - maximum value calculated at each sample interval over a time range   * **MAX** - maximum value calculated at each sample interval over a time range
   * **AVG** - mean value calculated at each sample interval over a time range.   * **AVG** - mean value calculated at each sample interval over a time range.
  
-For start and end, you can specify either an absolute value or a relative value.  Absolute values should be specified in ISO 8601 format (i.e. yyyy-MM-ddTHH:mm:ss).  You can also include a suffix of Z to indicate a UTC time stamp, or you can specify an offset from UTC.  If no time zone information is provided, the date is assumed to be UTC.  For example, if you wanted to specify 3:30:35am today in Central US time, you could specify 2017-08-01T03:30:35-06:00.   +== Get Plot Data ==
- +
-Relative values can be specified using * to represent the current time, *-1d "1 day before current time", *-27.5m "27.5 minutes before current time", and so on.  Possible time units when specifying a relative time stamp are: d, h, m, s, ms.+
  
-For the current value, specify NOW for the function parameter.  When you use NOW, you don't need to specify start or end time.  Additionally, you don't need to specify tag[0], tag[1] and so on for the tag names; you should just keep on repeating the tag parameter e.g. to get the current snapshot value for tags called Tag1 and Tag2, you would use: +Performs a plot data query on a single data source for a specified tags and date rangePlot is a special type of function that returns the minimum number of data points (for a given set of parameters) required to graphically plot an accurate time-series trend.
  
-gestalt/api/data/values/{my_dsn}?function=NOW&tag=Tag1&tag=Tag2+== Get Raw Data ==
  
-To get all raw data in a time period, you use the RAW function When asking for raw data, you don't need to specify sample interval or point countRAW queries should be considered unsafe – any code that requires this will likely perform badly in the appstore – and the developer should consider how to make use of aggregates to be able to efficiently request data and process itBasically RAW data requests are discouraged, due to the high size of data that might potentially be returned: +Performs a raw data query (i.e. requests unprocessed data) on data source for specified tag and date rangeRaw queries are generally not advised as they are likely to return a bulky result-set that may well be cropped by size constraints. If connecting to a Process Data Historian, it is far more efficient to request "Get Processed Data" with an "INTERP" function instead.
  
-gestalt/api/data/values/{my_dsn}?function=RAW&tag=Tag1&start=*-1d&end=* 
  
-For other functions, you need to provide either a step parameter that specifies the sample interval (e.g. 1m, 5m, 8h, 3d), or a points parameter that specified the number of samples you want to be returned:+=== Time Ranges ===
  
-gestalt/api/data/values/{my_dsn}?function=INTERP&tag=Tag1&tag=tag2&start=*-1d&end=*&step=1h +Historical data queries will expect a date-range.
-gestalt/api/data/values/{my_dsn}?function=PLOT&tag=Tag1&tag=tag2&start=*-1d&end=*&points=750+
  
-We also offer an interface that can stream real-time value changes to you as they occurinstead of you having to make periodic polling requests for NOW dataalthough this requires a client for Microsoft's SignalR platformSignalR clients are available for Java, Python, and various other languages, if this would be of interest.+For ''start'' and ''end'', you can specify either an absolute value or a relative value.  Absolute values should be specified in ISO 8601 format (i.e. ''yyyy-MM-ddTHH:mm:ss'').  You can also include a suffix of ''Z'' to indicate a UTC time stampor you can specify an offset from UTC.  If no time zone information is providedthe date is assumed to be UTC For example, if you wanted to specify 3:30:35am on 01 August 2017 in Central US time, you could specify ''2017-08-01T03:30:35-06:00'' 
  
 +Relative values can be specified using ''*'' to represent the current time.  For example: ''*-1d'' = "1 day before current time", ''*-27.5m'' = "27.5 minutes before current time", and so on.  Possible time units when specifying a relative time stamp are: ''d'', ''h'', ''m'', ''s'', ''ms''.
  
-More info on App Store API can be found [[https://appstore.intelligentplant.com/ApiHelp/Api/GET-Gestalt-api-data-values-dsn_tag[0]_tag[1]_function_start_end_points_step_annotations|here]]+More info on App Store API can be found [[https://appstore.intelligentplant.com/ApiHelp]]
  
  
dev/app_store_data_requests.1501588537.txt.gz · Last modified: 2017/08/01 11:55 by su