Sysdig Monitor API wrapper to manage notification channels and alerts
Setup
go get -u https://github.com/WojtekTomaszewski/sysdig-client/sdclient
Examples
Create Sysdig client
sc := sdclient.New().WithEndpoint(os.Getenv("ENDPOINT")).WithAPIKey(os.Getenv("APIKEY"))
List all alerts
a, _ := sc.ListAlerts()
b, _ := json.MarshalIndent(a, "", " ")
fmt.Println(string(b))
Create Slack alert channel
opt := sdclient.EmailNotificationChannelOptions{
NotifyOnResolve: true,
NotifyOnOk: true,
EmailRecipients: []string{"[email protected]"},
}
ch, _ := sdclient.NewNotificationChannel("test", "EMAIL", opt)