Skip to content

Commit 3c57aaa

Browse files
committed
Update save&restore doc
1 parent 5ea828e commit 3c57aaa

File tree

1 file changed

+74
-12
lines changed

1 file changed

+74
-12
lines changed

services/save-and-restore/doc/index.rst

Lines changed: 74 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ The a list of all the children nodes of the node with id `{uniqueNodeId}`
265265
}
266266
]
267267
268+
.. _Get a configuration:
269+
268270
Get a configuration
269271
"""""""""""""""""""
270272

@@ -295,7 +297,11 @@ Return: object describing the configuration data, essentially a list of PVs.
295297
"pvName": "13SIM1:{SimDetector-Cam:1}cam1:BinX"
296298
},
297299
{
298-
"pvName": "13SIM1:{SimDetector-Cam:1}cam1:BinY"
300+
"pvName": "13SIM1:{SimDetector-Cam:1}cam1:BinY",
301+
"comparison":{
302+
"comparisonMode":"ABSOLUTE",
303+
"tolerance":2.7
304+
}
299305
},
300306
{
301307
"pvName": "13SIM1:{SimDetector-Cam:2}cam2:BinX",
@@ -313,6 +319,8 @@ Return: object describing the configuration data, essentially a list of PVs.
313319
314320
Here the ``uniqueId`` field matches the ``unqiueId`` field of the configuration node.
315321

322+
The ``comparison`` field is optional and can be set individually on each element in the list.
323+
316324
Create a configuration
317325
""""""""""""""""""""""
318326

@@ -347,8 +355,10 @@ Body:
347355
"pvName": "13SIM1:{SimDetector-Cam:2}cam2:BinX",
348356
"readbackPvName": null,
349357
"readOnly": false,
350-
"pvCompareMode": "ABSOLUTE",
351-
"tolerance": 2.5
358+
"comparison": {
359+
"comparisonMode":"ABSOLUTE",
360+
"tolerance": 2.7
361+
}
352362
},
353363
{
354364
"pvName": "13SIM1:{SimDetector-Cam:2}cam2:BinY",
@@ -363,6 +373,9 @@ Body:
363373
The request parameter ``parentNodeId`` is mandatory and must identify an existing folder node. The client
364374
needs to specify a name for the new configuration node, as well as a user identity.
365375

376+
The ``comparison`` field is optional and can be set individually on each element in the list. If specified,
377+
the ``comparisonMode`` must be either "ABSOLUTE" or "RELATIVE", and the ``tolerance`` must be >=0.
378+
366379
Update a configuration
367380
""""""""""""""""""""""
368381

@@ -382,6 +395,8 @@ body will be removed.
382395
Snapshot Endpoints
383396
------------------
384397

398+
.. _Get a snapshot:
399+
385400
Get a snapshot
386401
""""""""""""""
387402

@@ -642,7 +657,7 @@ body will be removed.
642657
Get restorable items of a composite snapshot
643658
""""""""""""""""""""""""""""""""""""""""""""
644659

645-
***.../composite-snapshot/{uniqueId}/items**
660+
**.../composite-snapshot/{uniqueId}/items**
646661

647662
Method: GET
648663

@@ -761,6 +776,54 @@ Body:
761776
}
762777
]
763778
779+
Server Take Snapshot Endpoints
780+
------------------------------
781+
782+
**.../take-snapshot/{configNodeId}**
783+
784+
Method: GET
785+
786+
This will read PV values for all items listed in the configuration identified by ``configNodeId``. Upon successful
787+
completion, the response will hold an array of objects where each element is on the form:
788+
789+
.. code-block:: JSON
790+
791+
{
792+
"configPv": {
793+
"pvName": "RFQ-010:RFS-EVR-101:RFSyncWdt-SP",
794+
"readbackPvName": null,
795+
"readOnly": false
796+
},
797+
"value": {
798+
"type": {
799+
"name": "VDouble",
800+
"version": 1
801+
},
802+
"value": 100.0,
803+
"alarm": {
804+
"severity": "NONE",
805+
"status": "NONE",
806+
"name": "NONE"
807+
},
808+
"time": {
809+
"unixSec": 1639063122,
810+
"nanoSec": 320431469
811+
},
812+
"display": {
813+
"units": ""
814+
}
815+
}
816+
817+
**.../take-snapshot/{configNodeId}<?name=snapshotName&comment=snapshotComment>**
818+
819+
Method: PUT
820+
821+
This will read PV values for all items listed in the configuration identified by ``configNodeId``. Upon successful
822+
completion the data is persisted into the database. ``name`` and ``comment`` are optional query parameters and will
823+
default to the current date/time on the format ``yyyy-MM-dd HH:mm:ss.SSS``.
824+
825+
The response is a snapshot object representing the persisted data, see :ref:`Get a snapshot`
826+
764827
Server Restore Endpoints
765828
------------------------
766829

@@ -885,15 +948,14 @@ Comparisons are performed like so:
885948
* Table PVs are compared element wise, always using zero tolerance. Tables must be of same dimensions, and data types must match between columns.
886949
* Enum PVs are compared using zero tolerance.
887950

888-
In addition, the ``compareMode`` and ``skipReadback`` together with the presence of a read-back PV value is used to
889-
determine which value to compare to the stored value:
951+
The ``compareMode`` and ``tolerance`` are applied to all comparison operations, but can be overridden on each individual
952+
item in a configuration, see :ref:`Get a configuration`.
953+
954+
Equality between a stored value and the live value is determined on each PV like so:
890955

891-
* If a read-back PV name has been specified it's live value is compare to the stored value.
892-
* If a read-back PV name has not been specified, or if ``skipReadback`` is ``true``, then the live value of ``PV Name`` is used to compare to the stored value.
893-
* Compare mode=ABSOLUTE (default) will apply absolute delta comparison.
894-
* Compare mode=RELATIVE will apply relative comparison.
895-
* If an item in the configuration specifies a tolerance of zero, then a tolerance value specified in the API call will be ignored.
896-
* If the stored value is zero and compareMode is RELATIVE, then live value must also be zero to be treated as equal.
956+
* If the configuration of a PV does not specify a comparison mode and tolerance, the ``comparisonMode`` and ``tolerance`` request parameters are used. These however are optional and default to ABSOLUTE and zero respectively.
957+
* The base (reference) value is always the value stored in the value field of a snapshot item object. It corresponds to the ``pvName``` field, i.e. never the ``readbackPvName`` of a configuration item.
958+
* The live value used in the comparison is either the value corresponding to ``pvName``, or ``readbackPvName`` if specified. The latter can be overridden with the ``skipReadback`` request parameter.
897959

898960
Return value: a list of comparison results, one for each PV in the snapshot, e.g.:
899961

0 commit comments

Comments
 (0)