site-uptime-adaptor

0.1.6 • Public • Published

site-uptime-adaptor Build Status

siteuptime.com API wrapped in Node

Examples

Get session token

var siteUptimeAdaptor = require('site-uptime-adaptor');

siteUptimeAdaptor.adaptor.getToken({
  emailAddress: 'myaccountemail@gmail.com',
  password: 'myaccountpassword'
}, function(err, token) {
  console.log(token);
});
Example output
sdfoiusdofiusdfoiusdoifudf

Get servers status

...
siteUptimeAdaptor.status.getStatus(token, function(err, serverStatus) {
  console.log(serverStatus);
});
Example output
[{
    id: '1111',
    name: 'My Site',
    host: 'example.com',
    status: 'Failed'
}, {
    id: '123123',
    name: 'image server',
    host: 'img1.example.com',
    status: 'Ok'
}]

Get uptime for a server

...
  var monitorRequest = {
    monitorId: 1111,
    year: '2013',
    month: '06'
  };

  siteUptimeAdaptor.uptime.getMonthly(token, monitorRequest, function(err, serverStatus) {
    console.log(serverStatus);
  });
Example output
{ uptime: '99.995%',
  dailyStats:
   [ { date: '2013-06-01', uptime: '100.000%' },
     { date: '2013-06-02', uptime: '100.000%' },
    ...
     { date: '2013-06-20', uptime: '100.000%' },
     { date: '2013-06-21', uptime: '99.860%' },
     { date: '2013-06-30', uptime: '100.000%' } ]     
}

Readme

Keywords

none

Package Sidebar

Install

npm i site-uptime-adaptor

Weekly Downloads

0

Version

0.1.6

License

none

Last publish

Collaborators

  • ecoad