Skip to content

fakiolinho/updown-php

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

updown-php

A PHP wrapper for the updown.io API.

You need your API_KEY from your account's settings page to use this. Visit updown.io API documentation to see all settings you can use.

Requirements

  • PHP 5.4.0 or newer

Installation

The best way to install this package is through composer by running:

composer require fakiolinho/updown-php:~1.0

You could also add it in your project's composer.json file:

"require": {
	"fakiolinho/updown-php": "~1.0"
}

Then run:

composer update

Usage

All examples use the Composer autoloader.

List all your checks

<?php
require 'vendor/autoload.php';

use Foinikas\Updown\Updown;

$updown = new Updown(API_KEY);

$response = $updown->checks();

Show a single project's checks

<?php
require 'vendor/autoload.php';

use Foinikas\Updown\Updown;

$updown = new Updown(API_KEY);

$response = $updown->check(TOKEN);

Get all the downtimes of a check (paginated, 100 per call)

<?php
require 'vendor/autoload.php';

use Foinikas\Updown\Updown;

$updown = new Updown(API_KEY);

$response = $updown->downtimes(TOKEN);
$response = $updown->downtimes(TOKEN, ['page' => 2]);

Get detailed metrics about the check

<?php
require 'vendor/autoload.php';

use Foinikas\Updown\Updown;

$updown = new Updown(API_KEY);

$response = $updown->metrics(TOKEN);
$response = $updown->metrics(TOKEN, ['group' => 'host']);

About

A PHP wrapper for the updown.io API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages