blob: 1122394288f42b2d37d707e4085aab08e24ae114 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// SPDX-License-Identifier: GPL-3.0-or-later
package vcsa
import (
"errors"
"github.com/netdata/netdata/go/go.d.plugin/modules/vcsa/client"
"github.com/netdata/netdata/go/go.d.plugin/pkg/web"
)
func (vc *VCSA) validateConfig() error {
if vc.URL == "" {
return errors.New("URL not set")
}
if vc.Username == "" || vc.Password == "" {
return errors.New("username or password not set")
}
return nil
}
func (vc *VCSA) initHealthClient() (*client.Client, error) {
httpClient, err := web.NewHTTPClient(vc.Client)
if err != nil {
return nil, err
}
return client.New(httpClient, vc.URL, vc.Username, vc.Password), nil
}
|