New Relic API Wrapper

Make requests to any route

n = Oldrelic::API.new(new_relic_api_key)

r = n.get_api('v1', 'applications', app_id, 'data.json', data_hash)

puts Yajl::Parser.new.parse(r)

First part of the method is the request type

  • n.get_accounts calls GET /accounts

Pass in any further path elements

  • n.get_accounts(id) calls GET /accounts/xxx

Pass in parameters as a hash last

  • n.get_accounts('settings', thishash) calls GET /accounts/settings, with params parsed out of the thishash