go client library for PagerDuty v2 API
Go Makefile
Permalink
Failed to load latest commit information.
command Add schedules listing (#46) Oct 18, 2016
examples dont declare main twice in examples (#45) Oct 13, 2016
.gitignore add *.swp to gitignore (#25) Sep 5, 2016
Dockerfile add dockerfile May 11, 2016
LICENSE.txt README.md Feb 26, 2016
Makefile Add test. fix version issue (#40) Sep 28, 2016
README.md update README with CLI usage Sep 6, 2016
ability.go add ability API and CLI (#36) Sep 23, 2016
addon.go allow passing headers in http do call. fix manage incident call (#33) Sep 14, 2016
client.go Skip JSON encoding if no payload was given (#37) Sep 24, 2016
escalation_policy.go Make updates to Escalation Policies work (#35) Sep 22, 2016
event.go get rid of logrus from all core structs except CLI entries. fix sched… Sep 13, 2016
incident.go enable fetch log entries via incident api (#55) Dec 20, 2016
log_entry.go enable fetch log entries via incident api (#55) Dec 20, 2016
maintenance_window.go allow passing headers in http do call. fix manage incident call (#33) Sep 14, 2016
notification.go Refactor to work correctly with V2 API (#23) Sep 4, 2016
on_call.go Support the /oncalls endpoint in the CLI (#24) Sep 5, 2016
schedule.go Add support for start_day_of_week Nov 13, 2016
service.go Added missing slash to delete integration method url (#59) Dec 20, 2016
team.go allow passing headers in http do call. fix manage incident call (#33) Sep 14, 2016
user.go Fix misspelling in User struct and add JSON tags (#34) Sep 19, 2016
vendor.go Add vendor support (#49) Oct 22, 2016
webhook.go fix webhook struct member name (#58) Dec 20, 2016

README.md

go-pagerduty

go-pagerduty is a CLI and go client library for PagerDuty v2 API. godoc

Installation

go get github.com/PagerDuty/go-pagerduty

Usage

CLI

The CLI requires authentication token, which can be sepcified in .pd.yml file in home directory of the user, or passed as command line argument. Example of config file:

---
authtoken: fooBar

pd command provides a single entrypoint for all the API endpoints, with individual API represented by their own sub commands. For an exhaustive list of sub-commands, try:

pd --help

An example of the service sub-command

pd service list

From golang libraries

package main

import (
    "fmt"
    "github.com/PagerDuty/go-pagerduty"
)

var authtoken = "" // Set your auth token here

func main() {
    var opts pagerduty.ListEscalationPoliciesOptions
    client := pagerduty.NewClient(authtoken)
    if eps, err := client.ListEscalationPolicies(opts); err != nil {
        panic(err)
    } else {
        for _, p := range eps.EscalationPolicies {
            fmt.Println(p.Name)
        }
    }
}

License

Apache 2

Contributing

  1. Fork it ( https://github.com/PagerDuty/go-pagerduty/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request