Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

shift31/hostbase-api-client-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hostbase API Client for PHP

Basic usage (if you're using Composer)

  • In your project, run composer require shift31/hostbase-api-client:dev-master
  • Example script:
<?php

require_once('vendor/autoload.php');

use Shift31\HostbaseClient;

/* The constructor will accept username and password parameters,
if you setup basic auth yourself, or for when I get around to implementing it. */
$client = new HostbaseClient("http://your.hostbase.server");

/* Optionally return arrays instead of objects */
//$client->decodeJsonAsArray();


// perform a search, limiting to 100 servers, retrieving just FQDNs
print_r($client->search('your.domain', 100, false));

// perform the same search, retrieving all data
print_r($client->search('your.domain', 100, true));

For an example of adding/updating hosts, check out the PuppetDB importer: https://github.com/shift31/hostbase-importer-puppetdb

About

The Hostbase API Client Library for PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages