-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
31 lines (25 loc) · 785 Bytes
/
main.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
package main
import (
"context"
"fmt"
sumo "github.com/kumoroku/go-sumologic"
"os"
)
func main() {
configuration := sumo.NewConfiguration()
configuration.Host = os.Getenv("SUMOLOGIC_HOST")
configuration.Debug = true
client := sumo.NewAPIClient(configuration)
accessId := os.Getenv("SUMOLOGIC_ID")
accessKey := os.Getenv("SUMOLOGIC_KEY")
ctx := context.WithValue(context.Background(), sumo.ContextBasicAuth,
sumo.BasicAuth{UserName: accessId, Password: accessKey})
request := client.UserManagementApi.ListUsers(ctx)
users, _, err := client.UserManagementApi.ListUsersExecute(request)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("%v\n\n", users)
}
//http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}