• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..30-Aug-2019-

.gitignoreH A D30-Aug-20190

.travis.ymlH A D30-Aug-2019320 2318

LICENSEH A D30-Aug-20191.5 KiB3124

README.mdH A D30-Aug-20192.2 KiB7558

alert_conditions.goH A D30-Aug-20192 KiB6047

alert_events.goH A D30-Aug-20191.8 KiB6147

alert_events_test_fixtures.goH A D30-Aug-20191.7 KiB9287

application_deployments.goH A D30-Aug-20191.6 KiB5439

application_host_metrics.goH A D30-Aug-2019929 3927

application_hosts.goH A D30-Aug-20193.3 KiB9571

application_instance_metrics.goH A D30-Aug-2019977 3927

application_instances.goH A D30-Aug-20193.5 KiB9572

application_metrics.goH A D30-Aug-2019828 3725

application_metrics_test_fixtures.goH A D30-Aug-20193.3 KiB176169

applications.goH A D30-Aug-20193.9 KiB11288

applications_test_fixtures.goH A D30-Aug-20193.4 KiB166160

array.goH A D30-Aug-2019439 124

browser_applications.goH A D30-Aug-20191.4 KiB4936

common_test_fixtures.goH A D30-Aug-2019317 1814

component_metrics.goH A D30-Aug-2019779 3525

http_helper.goH A D30-Aug-20191.9 KiB10195

http_helper_test_fixtures.goH A D30-Aug-20192.2 KiB120110

key_transactions.goH A D30-Aug-20192.3 KiB7759

legacy_alert_policies.goH A D30-Aug-20192.6 KiB7960

main.goH A D30-Aug-20191.1 KiB4929

metrics.goH A D30-Aug-20193.3 KiB12992

mobile_application_metrics.goH A D30-Aug-2019876 3725

mobile_applications.goH A D30-Aug-20192.3 KiB6250

notification_channels.goH A D30-Aug-20192.7 KiB7961

server_metrics.goH A D30-Aug-2019782 3525

servers.goH A D30-Aug-20192.6 KiB9375

usages.goH A D30-Aug-20191.3 KiB5039

README.md

1[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/yfronto/newrelic)
2[![Build
3status](https://travis-ci.org/yfronto/newrelic.svg)](https://travis-ci.org/yfronto/newrelic)
4
5# New Relic API library for Go
6
7This is a Go library that wraps the [New Relic][1] REST
8API. It provides the needed types to interact with the New Relic REST API.
9
10It's still in progress and I haven't finished the entirety of the API, yet. I
11plan to finish all GET (read) operations before any POST (create) operations,
12and then PUT (update) operations, and, finally, the DELETE operations.
13
14The API documentation can be found from [New Relic][1],
15and you'll need an API key (for some operations, an Admin API key is
16required).
17
18## USAGE
19
20This library will provide a client object and any operations can be performed
21through it. Simply import this library and create a client to get started:
22
23```go
24package main
25
26import (
27  "github.com/yfronto/newrelic"
28)
29
30var api_key = "..." // Required
31
32func main() {
33  // Create the client object
34  client := newrelic.NewClient(api_key)
35
36  // Get the applciation with ID 12345
37  myApp, err := client.GetApplication(12345)
38  if err != nil {
39    // Handle error
40  }
41
42  // Work with the object
43  fmt.Println(myApp.Name)
44
45  // Some operations accept options
46  opts := &newrelic.AlertEventOptions{
47    // Only events with "MyProduct" as the product name
48    Filter: newRelic.AlertEventFilter{
49      Product: "MyProduct",
50    },
51  }
52  // Get a list of recent events for my product
53  events, err := client.GetAlertEvents(opts)
54  if err != nil {
55    // Handle error
56  }
57  // Display each event with some information
58  for _, e := range events {
59    fmt.Printf("%d -- %d (%s): %s\n", e.Timestamp, e.Id, e.Priority, e.Description)
60  }
61}
62```
63
64## Contributing
65
66As I work to populate all actions, bugs are bound to come up. Feel free to
67send me a pull request or just file an issue. Staying up to date with an API
68is hard work and I'm happy to accept contributors.
69
70**DISCLAIMER:** *I am in no way affiliated with New Relic and this work is
71merely a convenience project for myself with no guarantees. It should be
72considered "as-is" with no implication of responsibility. See the included
73LICENSE for more details.*
74
75[1]: http://www.newrelic.com