You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using api-reference.pagerduty.com to query list of incidents since 2019-03-10T03:00:00. I see the reponse back with list of all the incidents that occured. here is the GET api https://api.pagerduty.com/incidents?since=2019-03-10T03%3A00%3A00&time_zone=UTC
However, when I try doing the same in code, there are 0 responses
var incOptions pagerduty.ListIncidentsOptions
incOptions.Since = "2019-03-10T03:00:00"
current := time.Now()
Info.Println("Current time is:" + current.Format(time.RFC3339))
// incOptions.Until = current.Format(time.RFC3339)
// incOptions.Statuses= "acknowledged"
client := pagerduty.NewClient(authtoken)
if incs, incsError := client.ListIncidents(incOptions); incsError != nil {
Error.Println(incsError)
panic(incsError)
} else {
// fmt.Println(*incidents)
Info.Println(incs.Total)
for _, inc := range incs.Incidents {
Info.Println("Gathered list of incidents. Iterating over the list to produce to kafka...")
incJson, err := json.Marshal(inc)
if err != nil {
Error.Println(err)
panic(err)
}
Info.Println("About to produce follwoing incident to kafka" + string(incJson))
}
}
Can anyone please explain how to use this struct
https://godoc.org/github.com/PagerDuty/go-pagerduty#ListIncidentsOptions
i'm planning on using
since
orDateRage
attributes to fetch incidents since a point in time.The text was updated successfully, but these errors were encountered: