unikorp / kong-admin-api
Kong Admin Api for PHP Projects
v0.0.1-beta.1
2017-08-15 21:52 UTC
Requires
- php: ^7.1
- ext-json: *
- php-http/client-common: ^1.5
- php-http/discovery: ^1.3
- php-http/httplug: ^1.1
- php-http/message: ^1.6
Requires (Dev)
- php-http/guzzle6-adapter: ^1.1
- phpunit/phpunit: ^6.3
This package is not auto-updated.
Last update: 2024-11-05 23:54:43 UTC
README
Installation
Step 1: Download the Library
Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:
$ composer require "unikorp/kong-admin-api"
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Download a client implementation
If your project is not already using a client implementation, select one form the list of virtual packages php-http/client-implementation, and then download it.
For this example we are going to use
php-http/guzzle6-adapter
$ composer require "php-http/guzzle6-adapter"
Usage
<?php require_once('./vendor/autoload.php'); // configure KongAdminApi client $configurator = new \Unikorp\KongAdminApi\Configurator(); $configurator->setBaseUri('http://example.com:8001/'); // create KongAdminApi client $client = new \Unikorp\KongAdminApi\Client($configurator); // retrieve node information $response = $client->getNode('information')->retrieveNodeInformation(); $information = json_decode($response->getBody()->getContents(), true); var_dump($information);