2017 © Pedro Peláez
 

library cachet-api

PHP Implementation of the Cachet API

image

checkitonus/cachet-api

PHP Implementation of the Cachet API

  • Friday, June 15, 2018
  • by awjudd
  • Repository
  • 3 Watchers
  • 4 Stars
  • 68 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 127 % Grown

The README.md

Cachet SDK

CheckItOn.Us Logo, (*1)

Build Status, (*2)

Easy to use Cachet API implementation., (*3)

Installation

$ composer require checkitonus/cachet-api
{
    "require": {
        "checkitonus/cachet-api": "~1"
    }
}

Then, in your PHP file, all you need to do is require the autoloader:, (*4)

require_once 'vendor/autoload.php';

use CheckItOnUs\Cachet\Server;

$server = new Server([
    'api_key' => 'API-KEY',
    'base_url' => 'https://demo.cachethq.io', // The base URL for the Cachet installation
]);

// Should return pong
echo $server->ping();

API Components

Once installed, you will have access to several objects all of which will hit the API and retrieve the data as needed., (*5)

Please Note: Although all of these samples are using the Component class, they are available for the following objects:, (*6)

  • CheckItOnUs\Cachet\Component
  • CheckItOnUs\Cachet\ComponentGroup
  • CheckItOnUs\Cachet\Incident
  • CheckItOnUs\Cachet\IncidentUpdate (In development - Cachet 2.4 feature)
require_once 'vendor/autoload.php';

use CheckItOnUs\Cachet\Server;
use CheckItOnUs\Cachet\Component;

$server = new Server([
    'api_key' => 'API-KEY',
    'base_url' => 'https://demo.cachethq.io', // The base URL for the Cachet installation
]);

// Find a component based on the name
$component = Component::on($server)->findByName('API');

// Find a component based on the ID
$component = Component::on($server)->findById(1);

// Find all components
Component::on($server)->all();

CRUD Operations

Creation

require_once 'vendor/autoload.php';

use CheckItOnUs\Cachet\Server;
use CheckItOnUs\Cachet\Component;

$server = new Server([
    'api_key' => 'API-KEY',
    'base_url' => 'https://demo.cachethq.io', // The base URL for the Cachet installation
]);

// Fluent API
$component = (new Component($server))
                ->setName('Name Here')
                ->setStatus(Component::OPERATIONAL)
                ->create();

Update

require_once 'vendor/autoload.php';

use CheckItOnUs\Cachet\Server;
use CheckItOnUs\Cachet\Component;

$server = new Server([
    'api_key' => 'API-KEY',
    'base_url' => 'https://demo.cachethq.io', // The base URL for the Cachet installation
]);

// Fluent API
Component::on($server)
    ->findById(1)
    ->setName('Name Here')
    ->setStatus(Component::OPERATIONAL)
    ->update();

Delete

require_once 'vendor/autoload.php';

use CheckItOnUs\Cachet\Server;
use CheckItOnUs\Cachet\Component;

$server = new Server([
    'api_key' => 'API-KEY',
    'base_url' => 'https://demo.cachethq.io', // The base URL for the Cachet installation
]);

// Fluent API
Component::on($server)
    ->findById(1)
    ->delete();

The Versions

15/06 2018

dev-master

9999999-dev

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2018

dev-analysis-qgoJlk

dev-analysis-qgoJlk

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

23/01 2018

1.0.8

1.0.8.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

24/08 2017

1.0.7

1.0.7.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

13/08 2017

1.0.6

1.0.6.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

13/08 2017

1.0.5

1.0.5.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

13/08 2017

1.0.4

1.0.4.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

13/08 2017

1.0.2

1.0.2.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

29/07 2017

1.0.1

1.0.1.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires

25/07 2017

1.0.0

1.0.0.0

PHP Implementation of the Cachet API

  Sources   Download

MIT

The Requires

 

The Development Requires