Skip to content

Node.js module for creating and dowloading reports from Opoint's monitor solution

License

Notifications You must be signed in to change notification settings

zrrrzzt/opoint-report

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#opoint-report Build Status

Node.js module for creating and downloading reports from Opoint's monitor solution

##Installation Use npm

$ npm install opoint-report

##Test Make sure you have Mocha installed.

$ npm test

##Usage

You can create and download reports.

At the moment download is limited to the latest report created. That might change in future versions.

##Create report Creates a new report

Requires sessionkey and coookiejar provided by the login method.

Required params

reportTemplate - Valid options 1, 2, 3, 11, 12, 13, 17, 18 , 19, 20

reportTitle

reportHandleIdentical - Valid options 0, 2, 3

startDate - timestamp format

endDate - timestamp format

var opoint = require('opoint-report')
  , loginOpts = {
    username: 'MyUserName',
    password: 'MyTopSecretPassword'
  };

opoint.login(loginOpts, function(err, data){
  if(err){
    console.error(err);
  } else {

    var repOpts = {
          session: data.session,
          opointJar: data.opointJar,
          reportTemplate: '18',
          reportTitle: 'API test - new and improved',
          reportHandleIdentical:'0',
          startDate:1406847600,
          endDate:1409525999
        }
      ;

    opoint.createReport(repOpts, function(error, crdata){
      if(error){
        console.error(error);
      } else {
        console.log(crdata.status);
      }
    });
  }
});

##Dowload report

Downloads the latest created report.

Requires sessionkey and coookiejar provided by the login method.

Required params

fileName

var opoint = require('opoint-report')
  , loginOpts = {
    username: 'MyUserName',
    password: 'MyTopSecretPassword'
  };

opoint.login(loginOpts, function(err, data){
  if(err){
    console.error(err);
  } else {
    var dlOpts = {
          session: data.session,
          opointJar: data.opointJar,
          fileName: 'report.xlsx'
        }
      ;
    opoint.downloadReport(dlOpts, function(error, dldata){
      if(error){
        console.error(error);
      } else {
        console.log(dldata.status);
      }
    });
  }
});

##Disclaimer This is not an official API for Opoint's services.

About

Node.js module for creating and dowloading reports from Opoint's monitor solution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published