opentofu/vendor/github.com/PagerDuty/go-pagerduty
2017-03-09 19:33:21 +02:00
..
ability.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
addon.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
client.go Vendor update (#12559) 2017-03-09 19:33:21 +02:00
Dockerfile Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
escalation_policy.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
event.go provider/pagerduty: Updated implementation of pagerduty_vendor & pagerduty_service_integration (#12357) 2017-03-01 23:59:16 +00:00
incident.go provider/pagerduty Add delete support to pagerduty_service_integration (#10891) 2016-12-24 14:43:06 +00:00
LICENSE.txt Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
log_entry.go provider/pagerduty: Updated implementation of pagerduty_vendor & pagerduty_service_integration (#12357) 2017-03-01 23:59:16 +00:00
maintenance_window.go Vendor update (#12559) 2017-03-09 19:33:21 +02:00
Makefile Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
notification.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
on_call.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
README.md Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
schedule.go provider/pagerduty pagerduty_schedule - support for start_day_of_week (schedule restriction) (#10069) 2016-12-18 11:23:00 +00:00
service.go provider/pagerduty: Allow timeouts to be disabled (pagerduty_service) (#11483) 2017-01-29 16:06:44 +00:00
team.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
user.go Vendoring go-pagerduty 2016-10-24 14:19:55 +02:00
vendor.go provider/pagerduty: Updated implementation of pagerduty_vendor & pagerduty_service_integration (#12357) 2017-03-01 23:59:16 +00:00
webhook.go provider/pagerduty Add delete support to pagerduty_service_integration (#10891) 2016-12-24 14:43:06 +00:00

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