timdiels1/newrelic-api

New Relic API v2 client library for PHP

v1.0.0 2017-07-11 14:41 UTC

This package is auto-updated.

Last update: 2024-05-06 20:55:48 UTC


README

Copyright (c) 2017 Tim Diels.

Documentation

Installation

The wrapper is available on Packagist (timdiels1/newrelic-api) and can be installed using Composer:

composer require timdiels1/newrelic-api

Usage

You will need an Admin or REST API key from New Relic to use the wrapper. The wrapper can either be used by instantiating endpoints directly.

use timdiels1\NewRelicApi\NewRelic;

$baseUrl = 'https://api.newrelic.com/v2/';
$apiKey = 'thisisnotrealyouwillneedanapikey';

$client = new Newrelic($baseUrl, $apiKey);
$isAvailable = $client->isAvailable();

Endpoints

  • isAvailable()
  • getServers()

Other calls can be made by manually building a request using buildRequest and then calling it:

$response = $client->buildRequest($url, $method, $data);