mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
refact: cscli papi (#3222)
* cscli papi status - fix nil deref + func test * cscli papi: extract methods status(), sync() * papi status -> stdout * fix nil deref * cscli support dump: include papi status * lint
This commit is contained in:
parent
c8750f604c
commit
4d10e9df00
4 changed files with 131 additions and 68 deletions
|
@ -34,6 +34,14 @@ func CAPI(c *csconfig.Config) error {
|
|||
}
|
||||
|
||||
func PAPI(c *csconfig.Config) error {
|
||||
if err := CAPI(c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := CAPIRegistered(c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if c.API.Server.OnlineClient.Credentials.PapiURL == "" {
|
||||
return errors.New("no PAPI URL in configuration")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue