timdiels1 / newrelic-api
New Relic API v2 client library for PHP
v1.0.0
2017-07-11 14:41 UTC
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- phpunit/phpunit: ^6.1
This package is auto-updated.
Last update: 2024-11-06 22:16:49 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);