Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Mar 25, 2024
1 parent 7add0bd commit 60734a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docs/yamcs_parameter-archive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Synopsis
.. rst-class:: synopsis

| **yamcs parameter-archive** rebuild <*START*> <*STOP*>
| **yamcs parameter-archive** purge

Description
Expand All @@ -29,16 +30,20 @@ Commands
Rebuild run as an asynchronous operation: this command will not await the outcome.


.. describe:: purge

Remove all data from the Parameter Archive

Options
-------

.. option:: <START>

Date specification in ISO format or as detailed under `Timestamps`_.
With ``rebuild``, date specification in ISO format or as detailed under `Timestamps`_.

.. option:: <STOP>

Date specification in ISO format or as detailed under `Timestamps`_.
With ``rebuild``, date specification in ISO format or as detailed under `Timestamps`_.


Timestamps
Expand Down
11 changes: 10 additions & 1 deletion src/yamcs/cli/parameter_archive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from yamcs.cli import utils
from sys import stdout

from yamcs.client import YamcsClient

from yamcs.cli import utils


class ParameterArchiveCommand(utils.Command):
def __init__(self, parent):
Expand Down Expand Up @@ -29,6 +32,8 @@ def __init__(self, parent):
)
subparser = self.create_subparser(
subparsers, "purge", "Remove all data from the Parameter Archive"
)
subparser.set_defaults(func=self.purge)

def rebuild(self, args):
opts = utils.CommandOptions(args)
Expand All @@ -46,4 +51,8 @@ def purge(self, args):
client = YamcsClient(**opts.client_kwargs)
archive = client.get_archive(opts.require_instance())

stdout.write("Purging Parameter Archive... ")
stdout.flush()
archive.purge_parameter_archive()
stdout.write("done\n")
stdout.flush()

0 comments on commit 60734a1

Please sign in to comment.