GithubHelp home page GithubHelp logo

upchuk / pingdom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sgrodzicki/pingdom

0.0 3.0 0.0 114 KB

A PHP library for dealing with the Pingdom REST API

Home Page: http://www.pingdom.com/services/api/

License: MIT License

PHP 100.00%

pingdom's Introduction

Pingdom REST API

A PHP module to make use of the Pingdom REST API for you to automate your interaction with the Pingdom system.

Installation

The best way to install the library is by using Composer. Add the following to composer.json in the root of your project:

{ 
    "require": {
        "sgrodzicki/pingdom": "1.1.*"
    }
}

Then, on the command line:

curl -s http://getcomposer.org/installer | php
php composer.phar install

Use the generated vendor/.composer/autoload.php file to autoload the library classes.

Basic usage

<?php

$username = ''; // Pingdom username
$password = ''; // Pingdom password
$token    = ''; // Pingdom application key (32 characters)

$pingdom = new \Pingdom\Client($username, $password, $token);

// List of probe servers
$probes = $pingdom->getProbes();
foreach ($probes as $probe) {
    echo $probe->getName() . PHP_EOL;
}

// List of checks
$checks  = $pingdom->getChecks();
foreach ($checks as $check) {
    $results = $pingdom->getResults($check['id']);
}

Tests

Build Status

The client is tested with phpunit; you can run the tests, from the repository's root, by doing:

phpunit

Some tests require internet connection (to test against a real API response), so they are disabled by default; to run them add a credentials.php file in the root of your project:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$username = '[your username]';
$password = '[your password]';
$token    = '[your token]';

and run the tests, from the repository's root, by doing:

phpunit --bootstrap credentials.php

pingdom's People

Contributors

sgrodzicki avatar

Watchers

James Cloos avatar Daniel Sipos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.