100 lines
2.5 KiB
HTML
100 lines
2.5 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<title>Retrieval Documentation</title>
|
|
<meta name="keywords" content="PSI, DAQ, Databuffer">
|
|
<meta name="author" content="Dominik Werder">
|
|
<link rel="shortcut icon" href="about:blank"/>
|
|
<link rel="stylesheet" href="style.css"/>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Retrieval Documentation</h1>
|
|
|
|
<h2>HTTP API documentation</h2>
|
|
|
|
<p>This API follows the common convention that the addition of a key to a json object is not considered a breaking change.</p>
|
|
|
|
<p>Currently available:</p>
|
|
<ul>
|
|
<li><a href="#query-binned">Query binned data</a></li>
|
|
</ul>
|
|
|
|
<a id="query-binned"></a>
|
|
<h2>Query binned data</h2>
|
|
<p><strong>Method:</strong> GET</p>
|
|
<p><strong>URL:</strong> https://data-api.psi.ch/api/4/binned</p>
|
|
<p><strong>Query parameters:</strong></p>
|
|
<ul>
|
|
<li>channel_backend (e.g. "sf-databuffer")</li>
|
|
<li>channel_name (e.g. "SLAAR-LSCP4-LAS6891:CH7:1")</li>
|
|
<li>beg_date (e.g. "2021-05-26T07:10:00.000Z")</li>
|
|
<li>end_date (e.g. "2021-05-26T07:16:00.000Z")</li>
|
|
<li>bin_count (e.g. "6")</li>
|
|
</ul>
|
|
<p><strong>Request header:</strong> "Accept" must be "application/json"</p>
|
|
|
|
<h4>CURL example:</h4>
|
|
<pre>
|
|
curl -H 'Accept: application/json' 'http://sf-daqbuf-21:8380/api/4/binned?channel_backend=sf-databuffer
|
|
&channel_name=SLAAR-LSCP4-LAS6891:CH7:1&beg_date=2021-05-25T00:00:00.000Z&end_date=2021-05-26T00:00:00.000Z&bin_count=3'
|
|
</pre>
|
|
|
|
<h4>Partial result</h4>
|
|
<p>Note the keys <strong>continue_at</strong> and <strong>missing_bins</strong>.</p>
|
|
<pre>
|
|
{
|
|
"continue_at": "2021-05-25T16:00:00.000Z",
|
|
"missing_bins": 2,
|
|
"avgs": [
|
|
340.87640380859375,
|
|
340.7442321777344,
|
|
340.58685302734375,
|
|
341.04608154296875
|
|
],
|
|
"counts": [
|
|
143076,
|
|
143077,
|
|
143076,
|
|
143076
|
|
],
|
|
"maxs": [
|
|
452,
|
|
452,
|
|
459,
|
|
458
|
|
],
|
|
"mins": [
|
|
231,
|
|
240,
|
|
239,
|
|
239
|
|
],
|
|
"ts_bin_edges": [
|
|
"2021-05-25T00:00:00.000Z",
|
|
"2021-05-25T04:00:00.000Z",
|
|
"2021-05-25T08:00:00.000Z",
|
|
"2021-05-25T12:00:00.000Z",
|
|
"2021-05-25T16:00:00.000Z"
|
|
]
|
|
}
|
|
</pre>
|
|
|
|
<h4>Complete result</h4>
|
|
<p>A complete result will not have a <strong>continue_at</strong> key.</p>
|
|
|
|
<h4>Finalised range</h4>
|
|
<p>If the server can determine that no more data will be added to the requested time range
|
|
then it will add the flag <strong>finalised_range</strong> to the response.</p>
|
|
|
|
|
|
<h2>Feedback and comments very much appreciated!</h2>
|
|
<p>dominik.werder@psi.ch</p>
|
|
<p>or please assign me a JIRA ticket.</p>
|
|
|
|
<div id="footer"></div>
|
|
|
|
</body>
|
|
</html>
|