MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / newStatusCmd

Method newStatusCmd

cmd/crowdsec-cli/clipapi/papi.go:100–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100func (cli *cliPapi) newStatusCmd() *cobra.Command {
101 cmd := &cobra.Command{
102 Use: "status",
103 Short: "Get status of the Polling API",
104 Args: args.NoArgs,
105 DisableAutoGenTag: true,
106 RunE: func(cmd *cobra.Command, _ []string) error {
107 cfg := cli.cfg()
108 ctx := cmd.Context()
109
110 db, err := require.DBClient(ctx, cfg.DbConfig)
111 if err != nil {
112 return err
113 }
114
115 return cli.Status(ctx, color.Output, db)
116 },
117 }
118
119 return cmd
120}
121
122func (cli *cliPapi) sync(ctx context.Context, db *database.Client) error {
123 cfg := cli.cfg()

Callers 1

NewCommandMethod · 0.95

Calls 3

StatusMethod · 0.95
DBClientFunction · 0.92
cfgMethod · 0.80

Tested by

no test coverage detected