ias/infoblox

Provides a PHP client library and Symfony bundle for interacting with Infoblox Grid Manager


License
MIT

Documentation

ias/infoblox

This project provides a PHP client library and Symfony bundle for interacting with Infoblox Grid Manager.

Installation

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

$ composer require ias/infoblox

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require ias/infoblox

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new IAS\InfobloxBundle\IASInfobloxBundle(),
        );

        // ...
    }

    // ...
}

Configure the bundle by adding the following container parameters:

ib_grid_manager_url: 'https://ipam.example.com'
ib_username: username
ib_password: password

Usage Example

require 'vendor/autoload.php';
$client = new \GuzzleHttp\Client(['base_uri' => 'https://ipam.example.com/wapi/v2.7.1/', 'auth' => ['username', 'password']]);
$api = new \IAS\Infoblox\Wapi($client);
try {
    $result = $api->get('ipv4address', ['ip_address' => '172.16.13.38']);
    print_r($result);
} catch (\IAS\Infoblox\WapiException $e) {
    print($e->getMessage());
}

Symfony Bundle Usage Example

$api = $this->container->get('infoblox.wapi');     
try {
    $result = $api->get('ipv4address', ['ip_address' => '172.16.13.38']);
    print_r($result);
} catch (\IAS\Infoblox\WapiException $e) {
    print($e->getMessage());
}

Although the infoblox.wapi service is public it is recommended instead to inject interface IAS\Infoblox\WapiInterface into a service class.

Developers

Requirements

  • PHP 7
  • Composer

Build

composer build