Skip to content

Commit abab164

Browse files
committed
Make start/stop optional on parchive rebuild
1 parent a1640b9 commit abab164

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

  • yamcs-client/src/yamcs/client/archive

yamcs-client/src/yamcs/client/archive/client.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,12 +1197,16 @@ def rebuild_histogram(
11971197
url = f"/archive/{self._instance}/tables/{table}:rebuildHistogram"
11981198
self.ctx.post_proto(url, data=req.SerializeToString())
11991199

1200-
def rebuild_parameter_archive(self, start: datetime, stop: datetime):
1200+
def rebuild_parameter_archive(
1201+
self,
1202+
start: Optional[datetime] = None,
1203+
stop: Optional[datetime] = None,
1204+
):
12011205
"""
12021206
Rebuilds the Parameter Archive.
12031207
1204-
The rebuild must be constrained by using the
1205-
``start`` and ``stop`` parameters. This values
1208+
The rebuild may be constrained by using the
1209+
``start`` and ``stop`` parameters. These values
12061210
are only hints to the Parameter Archive, which
12071211
will extend the requested range based on archive
12081212
segmentation.
@@ -1212,13 +1216,15 @@ def rebuild_parameter_archive(self, start: datetime, stop: datetime):
12121216
method will not await the outcome.
12131217
12141218
:param start:
1215-
Start time
1219+
Start time. This argument is optional since Yamcs v5.11.4
12161220
:param stop:
1217-
Stop time
1221+
Stop time. This argument is optional since Yamcs v5.11.4
12181222
"""
12191223
req = parameter_archive_service_pb2.RebuildRangeRequest()
1220-
req.start.MergeFrom(to_server_time(start))
1221-
req.stop.MergeFrom(to_server_time(stop))
1224+
if start:
1225+
req.start.MergeFrom(to_server_time(start))
1226+
if stop:
1227+
req.stop.MergeFrom(to_server_time(stop))
12221228
url = f"/archive/{self._instance}/parameterArchive:rebuild"
12231229
self.ctx.post_proto(url, data=req.SerializeToString())
12241230

0 commit comments

Comments
 (0)