Example #1
0
        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "n=|name=",
                "A unique name for the feed",
                n => _name = ArgumentString.Normalize(n));

            Options.Add(
                "l=|location=",
                "The feed location; this may be a NuGet v2 or v3 feed URL, or a local filesystem path on the Seq server",
                l => _location = ArgumentString.Normalize(l));

            Options.Add(
                "u=|username="******"The username Seq should supply when connecting to the feed, if authentication is required",
                n => _username = ArgumentString.Normalize(n));

            Options.Add(
                "p=|password="******"A feed password, if authentication is required; note that `--password-stdin` is more secure",
                p => _password = ArgumentString.Normalize(p));

            Options.Add(
                "password-stdin",
                "Read the feed password from `STDIN`",
                _ => _passwordStdin = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }
Example #2
0
        public RenderCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "i=|id=",
                "The id of a single dashboard to render",
                t => _id = ArgumentString.Normalize(t));
            Options.Add("c=|chart=", "The title of a chart on the dashboard to render",
                        c => _chartTitle = ArgumentString.Normalize(c));
            Options.Add("last=",
                        "A duration over which the chart should be rendered, e.g. `7d`; this will be aligned to an interval boundary; either `--last` or `--start` and `--end` must be specified",
                        v => _lastDuration = ArgumentString.Normalize(v));
            Options.Add("by=",
                        "The time-slice interval for the chart data, as a duration, e.g. `1h`",
                        v => _intervalDuration = ArgumentString.Normalize(v));
            _range      = Enable <DateRangeFeature>();
            _signal     = Enable <SignalExpressionFeature>();
            _timeout    = Enable <TimeoutFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
            _connection = Enable <ConnectionFeature>();
        }
Example #3
0
        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "t=|title=",
                "A title for the API key",
                t => _title = ArgumentString.Normalize(t));

            Options.Add(
                "token=",
                "A pre-allocated API key token; by default, a new token will be generated and written to `STDOUT`",
                t => _token = ArgumentString.Normalize(t));

            _properties = Enable <PropertiesFeature>();

            Options.Add(
                "filter=",
                "A filter to apply to incoming events",
                f => _filter = ArgumentString.Normalize(f));

            Options.Add(
                "minimum-level=",
                "The minimum event level/severity to accept; the default is to accept all events",
                v => _level = ArgumentString.Normalize(v));

            Options.Add(
                "use-server-timestamps",
                "Discard client-supplied timestamps and use server clock values",
                _ => _useServerTimestamps = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }
Example #4
0
        public ListCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            _output     = Enable(new OutputFormatFeature(config.Output));
            _connection = Enable <ConnectionFeature>();
        }
Example #5
0
        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "t=|title=",
                "A title for the API key",
                t => _title = ArgumentString.Normalize(t));

            Options.Add(
                "token=",
                "A pre-allocated API key token; by default, a new token will be generated and written to `STDOUT`",
                t => _token = ArgumentString.Normalize(t));

            _properties = Enable <PropertiesFeature>();

            Options.Add(
                "filter=",
                "A filter to apply to incoming events",
                f => _filter = ArgumentString.Normalize(f));

            Options.Add(
                "minimum-level=",
                "The minimum event level/severity to accept; the default is to accept all events",
                v => _level = ArgumentString.Normalize(v));

            Options.Add(
                "use-server-timestamps",
                "Discard client-supplied timestamps and use server clock values",
                _ => _useServerTimestamps = true);

            Options.Add(
                "permissions=",
                "A comma-separated list of permissions to delegate to the API key; valid permissions are `Ingest` (default), `Read`, `Write`, `Project` and `System`",
                v => _permissions = ArgumentString.NormalizeList(v));

            Options.Add(
                "connect-username="******"A username to connect with, useful primarily when setting up the first API key",
                v => _connectUsername = ArgumentString.Normalize(v));

            Options.Add(
                "connect-password="******"When `connect-username` is specified, a corresponding password",
                v => _connectPassword = ArgumentString.Normalize(v));

            Options.Add(
                "connect-password-stdin",
                "When `connect-username` is specified, read the corresponding password from `STDIN`",
                _ => _connectPasswordStdin = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }
Example #6
0
        public TailCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "f=|filter=",
                "An optional server-side filter to apply to the stream, for example `@Level = 'Error'`",
                v => _filter = v);

            _output     = Enable(new OutputFormatFeature(config.Output));
            _signal     = Enable <SignalExpressionFeature>();
            _connection = Enable <ConnectionFeature>();
        }
Example #7
0
        public ListCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            _entityIdentity = Enable(new EntityIdentityFeature("workspace", "list"));
            _entityOwner    = Enable(new EntityOwnerFeature("workspace", "list", _entityIdentity));
            _output         = Enable(new OutputFormatFeature(config.Output));
            _connection     = Enable <ConnectionFeature>();
        }
Example #8
0
 public QueryCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
     _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
     Options.Add("q=|query=", "The query to execute", v => _query = v);
     _range  = Enable <DateRangeFeature>();
     _signal = Enable <SignalExpressionFeature>();
     Options.Add("timeout=", "The query execution timeout in milliseconds", v => _timeoutMS = int.Parse(v?.Trim() ?? "0"));
     _output     = Enable(new OutputFormatFeature(config.Output));
     _connection = Enable <ConnectionFeature>();
 }
Example #9
0
        public ListCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "i=|id=",
                "The id of a single retention policy to list",
                id => _id = id);

            _output     = Enable(new OutputFormatFeature(config.Output));
            _connection = Enable <ConnectionFeature>();
        }
Example #10
0
        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "n=|name=",
                "A unique username for the user",
                u => _username = ArgumentString.Normalize(u));

            Options.Add(
                "d=|display-name=",
                "A long-form name to aid in identifying the user",
                d => _displayName = ArgumentString.Normalize(d));

            Options.Add(
                "f=|filter=",
                "A view filter that limits the events visible to the user",
                f => _filter = ArgumentString.Normalize(f));

            Options.Add(
                "r=|role=",
                "The title of a role that grants the user permissions on the server; if not specified, the default new user role will be assigned",
                r => _roleTitle = ArgumentString.Normalize(r));

            Options.Add(
                "e=|email=",
                "The user's email address (enables a Gravatar image for the user)",
                e => _emailAddress = ArgumentString.Normalize(e));

            Options.Add(
                "p=|password="******"An initial password for the user, if username/password authentication is in use; note that `--password-stdin` is more secure",
                p => _password = ArgumentString.Normalize(p));

            Options.Add(
                "password-stdin",
                "Read the initial password for the user from `STDIN`, if username/password authentication is in use",
                _ => _passwordStdin = true);

            Options.Add(
                "no-password-change",
                "Don't force the user to change their password at next login",
                _ => _noPasswordChange = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }
Example #11
0
        bool _deleteAllEvents; // Currently the only supported option

        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "after=",
                "A duration after which the policy will delete events, e.g. `7d`",
                v => _afterDuration = ArgumentString.Normalize(v));

            Options.Add(
                "delete-all-events",
                "The policy should delete all events (currently the only supported option)",
                _ => _deleteAllEvents = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }
Example #12
0
        public ListCommand(SeqConnectionFactory connectionFactory, SeqCliOutputConfig outputConfig)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "n=|name=",
                "The name of the cluster node to list",
                n => _name = n);

            Options.Add(
                "i=|id=",
                "The id of a single cluster node to list",
                id => _id = id);

            _output     = Enable(new OutputFormatFeature(outputConfig));
            _connection = Enable <ConnectionFeature>();
        }
Example #13
0
        public SearchCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "f=|filter=",
                "A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'`",
                v => _filter = v);
            Options.Add(
                "c=|count=",
                $"The maximum number of events to retrieve; the default is {_count}",
                v => _count = int.Parse(v, CultureInfo.InvariantCulture));

            _range      = Enable <DateRangeFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
            _signal     = Enable <SignalExpressionFeature>();
            _connection = Enable <ConnectionFeature>();
        }
Example #14
0
        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "t=|title=",
                "A title for the signal",
                t => _title = ArgumentString.Normalize(t));

            Options.Add(
                "description=",
                "A description for the signal",
                d => _description = ArgumentString.Normalize(d));

            Options.Add(
                "f=|filter=",
                "Filter to associate with the signal",
                f => _filter = ArgumentString.Normalize(f));

            Options.Add(
                "group=",
                "An explicit group name to associate with the signal; the default is to infer the group from the filter",
                g => _group = ArgumentString.Normalize(g));

            Options.Add(
                "no-group",
                "Specify that no group should be inferred; the default is to infer the group from the filter",
                _ => _noGrouping = true);

            Options.Add(
                "protected",
                "Specify that the signal is editable only by administrators",
                _ => _isProtected = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }
Example #15
0
        public CreateCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "t=|title=",
                "A title for the workspace",
                t => _title = ArgumentString.Normalize(t));

            Options.Add(
                "description=",
                "A description for the workspace",
                d => _description = ArgumentString.Normalize(d));

            Options.Add(
                "dashboard=",
                "The id of a dashboard to include in the workspace",
                d => _dashboards.Add(ArgumentString.Normalize(d)));

            Options.Add(
                "query=",
                "The id of a saved query to include in the workspace",
                s => _queries.Add(ArgumentString.Normalize(s)));

            Options.Add(
                "signal=",
                "The id of a signal to include in the workspace",
                s => _signals.Add(ArgumentString.Normalize(s)));

            Options.Add(
                "protected",
                "Specify that the workspace is editable only by administrators",
                _ => _isProtected = true);

            _connection = Enable <ConnectionFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
        }