Copyright (c) 2017 Tim Diels.
The wrapper is available on Packagist (timdiels1/newrelic-api) and can be installed using Composer:
composer require timdiels1/newrelic-api
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();
- isAvailable()
- getServers()
Other calls can be made by manually building a request using buildRequest and then calling it:
$response = $client->buildRequest($url, $method, $data);