@@ -101,7 +101,7 @@ async def config_create(self, parentNodeId, *, configurationNode, configurationD
101101 )
102102 return await self .send_request (method , url , params = params , auth = auth )
103103
104- async def config_update (self , * , configurationNode , configurationData = None , auth = None ):
104+ async def config_update (self , * , configurationNode , configurationData , auth = None ):
105105 # Reusing docstrings from the threaded version
106106 method , url , params = self ._prepare_config_update (
107107 configurationNode = configurationNode , configurationData = configurationData
@@ -131,17 +131,57 @@ async def tags_delete(self, *, uniqueNodeIds, tag, auth=None):
131131 # TAKE-SNAPSHOT-CONTROLLER API METHODS
132132 # =============================================================================================
133133
134- def take_snapshot_get (self , uniqueNodeId ):
134+ async def take_snapshot_get (self , uniqueNodeId ):
135135 # Reusing docstrings from the threaded version
136136 method , url = self ._prepare_take_snapshot_get (uniqueNodeId = uniqueNodeId )
137- return self .send_request (method , url )
137+ return await self .send_request (method , url )
138138
139- def take_snapshot_save (self , uniqueNodeId , * , name = None , comment = None , auth = None ):
139+ async def take_snapshot_save (self , uniqueNodeId , * , name = None , comment = None , auth = None ):
140140 # Reusing docstrings from the threaded version
141141 method , url , url_params = self ._prepare_take_snapshot_save (
142142 uniqueNodeId = uniqueNodeId , name = name , comment = comment
143143 )
144- return self .send_request (method , url , url_params = url_params , auth = auth )
144+ return await self .send_request (method , url , url_params = url_params , auth = auth )
145+
146+ # =============================================================================================
147+ # SNAPSHOT-CONTROLLER API METHODS
148+ # =============================================================================================
149+
150+ async def snapshot_get (self , uniqueId ):
151+ # Reusing docstrings from the threaded version
152+ method , url = self ._prepare_snapshot_get (uniqueId = uniqueId )
153+ return await self .send_request (method , url )
154+
155+ async def snapshot_add (self , parentNodeId , * , snapshotNode , snapshotData , auth = None ):
156+ """
157+ Upload data for the new snapshot and save it to the database. The new node is created
158+ under the existing configuration node specified by ``parentNodeId``.
159+
160+ API: PUT /snapshot?parentNodeId={parentNodeId}
161+ """
162+ method , url , params = self ._prepare_snapshot_add (
163+ parentNodeId = parentNodeId , snapshotNode = snapshotNode , snapshotData = snapshotData
164+ )
165+ return await self .send_request (method , url , params = params , auth = auth )
166+
167+ async def snapshot_update (self , * , snapshotNode , snapshotData , auth = None ):
168+ """
169+ Upload and update data for an existing snapshot. Both ``snapshotNode`` and ``snapshotData``
170+ must have valid ``uniqueId`` fields pointing to an existing node.
171+
172+ API: POST /snapshot
173+ """
174+ method , url , params = self ._prepare_snapshot_update (snapshotNode = snapshotNode , snapshotData = snapshotData )
175+ return await self .send_request (method , url , params = params , auth = auth )
176+
177+ async def snapshots_get (self ):
178+ """
179+ Returns a list of all existing snapshots (list of ``snapshotNode`` objects).
180+
181+ API: GET /snapshots
182+ """
183+ method , url = self ._prepare_snapshots_get ()
184+ return await self .send_request (method , url )
145185
146186
147187SaveRestoreAPI .node_get .__doc__ = _SaveRestoreAPI_Threads .node_get .__doc__
@@ -159,3 +199,7 @@ def take_snapshot_save(self, uniqueNodeId, *, name=None, comment=None, auth=None
159199SaveRestoreAPI .tags_delete .__doc__ = _SaveRestoreAPI_Threads .tags_delete .__doc__
160200SaveRestoreAPI .take_snapshot_get .__doc__ = _SaveRestoreAPI_Threads .take_snapshot_get .__doc__
161201SaveRestoreAPI .take_snapshot_save .__doc__ = _SaveRestoreAPI_Threads .take_snapshot_save .__doc__
202+ SaveRestoreAPI .snapshot_get .__doc__ = _SaveRestoreAPI_Threads .snapshot_get .__doc__
203+ SaveRestoreAPI .snapshot_add .__doc__ = _SaveRestoreAPI_Threads .snapshot_add .__doc__
204+ SaveRestoreAPI .snapshot_update .__doc__ = _SaveRestoreAPI_Threads .snapshot_update .__doc__
205+ SaveRestoreAPI .snapshots_get .__doc__ = _SaveRestoreAPI_Threads .snapshots_get .__doc__
0 commit comments