Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seqcli retention (create|list|remove) #192

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

nblumhardt
Copy link
Member

Retention policy setup is quite fundamental, but missing from seqcli.

The requirement to specify removed signal expressions makes this task quite involved; this PR is just an "MVP" to get us started. Only --delete-all-events is supported. This will provide enough of a foundation that we can add full signal name/signal expression support in a follow-up.

> seqcli help retention
Usage: seqcli retention <sub-command> [<args>]

Available sub-commands are:
  create     Create a retention policy
  list       List retention policies
  remove     Remove a retention policy from the server

Type `seqcli help retention <sub-command>` for detailed help

> seqcli help retention create
seqcli retention create [<args>]

Create a retention policy

Arguments:
      --after=VALUE          A duration after which the policy will delete
                               events, e.g. `7d`
      --delete-all-events    The policy should delete all events (currently
                               the only supported option)
  -s, --server=VALUE         The URL of the Seq server; by default the `
                               connection.serverUrl` config value will be used
  -a, --apikey=VALUE         The API key to use when connecting to the server;
                               by default the `connection.apiKey` config
                               value will be used
      --profile=VALUE        A connection profile to use; by default the `
                               connection.serverUrl` and `connection.apiKey`
                               config values will be used
      --json                 Print output in newline-delimited JSON (the
                               default is plain text)
      --no-color             Don't colorize text output

> seqcli help retention list
seqcli retention list [<args>]

List retention policies

Arguments:
  -i, --id=VALUE             The id of a single retention policy to list
      --json                 Print output in newline-delimited JSON (the
                               default is plain text)
      --no-color             Don't colorize text output
  -s, --server=VALUE         The URL of the Seq server; by default the `
                               connection.serverUrl` config value will be used
  -a, --apikey=VALUE         The API key to use when connecting to the server;
                               by default the `connection.apiKey` config
                               value will be used
      --profile=VALUE        A connection profile to use; by default the `
                               connection.serverUrl` and `connection.apiKey`
                               config values will be used

> seqcli help retention remove
seqcli retention remove [<args>]

Remove a retention policy from the server

Arguments:
  -i, --id=VALUE             The id of a single retention policy to remove
  -s, --server=VALUE         The URL of the Seq server; by default the `
                               connection.serverUrl` config value will be used
  -a, --apikey=VALUE         The API key to use when connecting to the server;
                               by default the `connection.apiKey` config
                               value will be used
      --profile=VALUE        A connection profile to use; by default the `
                               connection.serverUrl` and `connection.apiKey`
                               config values will be used

The command name retention is a bit awkward, but retentionpolicy or retention-policy just seems like too many characters :-)

@KodrAus KodrAus merged commit 7686fad into datalust:dev Apr 30, 2021
@nblumhardt
Copy link
Member Author

Thanks! 👍

@CasperTDK
Copy link

When is a release planned?

@nblumhardt
Copy link
Member Author

Hi Casper! We were planning to ship a new seqcli in conjunction with Seq 2021.3, but looking at the inclusions so far, they're also suitable for use against 2021.2, so we'll cut a new maintenance release now.

I've created the #193 release PR, it may take a few days for us to get this all the way through the pipeline :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants