go-pagerduty is a CLI and go client library for PagerDuty v2 API. godoc
go get github.com/PagerDuty/go-pagerduty
package main
import (
"fmt"
"github.com/PagerDuty/go-pagerduty"
)
var subdomain = "" // Set your account name here
var authtoken = "" // Set your auth token here
func main() {
var opts pagerduty.ListEscalationPoliciesOptions
client := pagerduty.NewClient(subdomain, authtoken)
if eps, err := client.ListEscalationPolicies(opts); err != nil {
panic(err)
} else {
for _, p := range eps.EscalationPolicies {
fmt.Println(p.Name)
}
}
}
- Fork it ( https://github.com/PagerDuty/go-pagerduty/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request