示例#1
0
 /**
  * @covers UptimeRobot::deleteAlertContact
  */
 public function testDeleteAlertContact()
 {
     $this->assertNotEquals(null, $this->object->deleteAlertContact(static::$newUserId));
 }
示例#2
0
<?php

/**
 * File exemple of utilisation uptimerobot class
 * 
 * Before use replace 0000 by the value of id.
 * 
 * @version     1.0
 * @author      Watchful
 * @authorUrl   http://www.watchful.li
 * @license     GNU General Public License version 2 or later
 */
require_once 'src/uptimerobot.php';
$upRobot = new UptimeRobot();
$upRobot::configure('YOUR-API-KEY', 1);
$upRobot->setFormat('json');
//Define the format of responses (json or xml)
/**
 * Get monitors
 */
$upRobot->getMonitors();
//Get all monitors
$upRobot->getMonitors(00);
//Get one monitor by her id
$upRobot->getMonitors($monitors = 00, $customUptimeRatio = array('1', '7'), $logs = 0, $responseTimes = 1, $responseTimesAverage = 180, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1);
/**
 * New monitor
 */
$upRobot->newMonitor("Google", 'https://google.com', 1);
//Monitor URL
$upRobot->newMonitor("The W of Wikipedia", 'http://fr.wikipedia.org', 2, null, null, 2, 'W');