-
Notifications
You must be signed in to change notification settings - Fork 74
/
inputs_tcp_ssl.go
57 lines (48 loc) · 1.4 KB
/
inputs_tcp_ssl.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package client
import (
"github.com/splunk/terraform-provider-splunk/client/models"
"net/http"
"github.com/google/go-querystring/query"
)
func (client *Client) CreateTCPSSLInput(inputsTCPSSLObject *models.InputsTCPSSLObject) error {
values, err := query.Values(inputsTCPSSLObject)
if err != nil {
return err
}
endpoint := client.BuildSplunkURL(nil, "services", "data", "inputs", "tcp", "ssl", "ssl")
resp, err := client.Post(endpoint, values)
if err != nil {
return err
}
defer resp.Body.Close()
return nil
}
func (client *Client) ReadTCPSSLInput() (*http.Response, error) {
endpoint := client.BuildSplunkURL(nil, "servicesNS", "-", "-", "data", "inputs", "tcp", "ssl", "ssl")
resp, err := client.Get(endpoint)
if err != nil {
return nil, err
}
return resp, nil
}
func (client *Client) UpdateTCPSSLInput(name string, inputsTCPSSLObject *models.InputsTCPSSLObject) error {
values, err := query.Values(&inputsTCPSSLObject)
if err != nil {
return err
}
endpoint := client.BuildSplunkURL(nil, "services", "data", "inputs", "tcp", "ssl", name)
resp, err := client.Post(endpoint, values)
if err != nil {
return err
}
defer resp.Body.Close()
return nil
}
func (client *Client) ReadTCPSSLInputs() (*http.Response, error) {
endpoint := client.BuildSplunkURL(nil, "services", "data", "inputs", "tcp", "ssl")
resp, err := client.Get(endpoint)
if err != nil {
return nil, err
}
return resp, nil
}