Skip to content

Commit b74fa5c

Browse files
committed
DOC: docstings for the 'snapshots' API
1 parent 56e37bd commit b74fa5c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/save_and_restore_api/_api_threads.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,17 @@ def take_snapshot_get(self, uniqueNodeId):
588588
The returned list format matches the format of ``snapshotData["snapshotItems"]``.
589589
590590
API: GET /take-snapshot/{uniqueNodeId}
591+
592+
Parameters
593+
----------
594+
uniqueNodeId : str
595+
Unique ID of the configuration node.
596+
597+
Returns
598+
-------
599+
list[dict]
600+
List of PV values read from the control system. Each PV is represented as a dictionary
601+
of parameters. The format is consistent with the format of ``snapshotData["snapshotItems"]``.
591602
"""
592603
method, url = self._prepare_take_snapshot_get(uniqueNodeId=uniqueNodeId)
593604
return self.send_request(method, url)
@@ -599,6 +610,27 @@ def take_snapshot_save(self, uniqueNodeId, *, name=None, comment=None, auth=None
599610
the name of the snapshot node and ``comment`` specifies the node description.
600611
601612
API: PUT /take-snapshot/{uniqueNodeId}
613+
614+
Parameters
615+
----------
616+
uniqueNodeId : str
617+
Unique ID of the configuration node.
618+
name : str, optional
619+
Name of the new snapshot node. If not specified or None, the name is set to
620+
the date and time of the snapshot, e.g. ``2025-10-12 22:49:50.577``.
621+
comment : str, optional
622+
Description of the new snapshot node. If not specified or None, the comment
623+
is set to date and time of the snapshot, e.g. ``2025-10-12 22:49:50.577``.
624+
auth : httpx.BasicAuth, optional
625+
Object with authentication data (generated using ``auth_gen`` method). If not specified or None,
626+
then the authentication set using ``auth_set`` method is used.
627+
628+
Returns
629+
-------
630+
dict
631+
Dictionary contains snapshot node metadata and snapshot data of the node
632+
that was created. The dictionary contains two keys: ``snapshotNode`` and
633+
``snapshotData`` as returned by the server.
602634
"""
603635
method, url, params = self._prepare_take_snapshot_save(
604636
uniqueNodeId=uniqueNodeId, name=name, comment=comment

0 commit comments

Comments
 (0)