aruba-instant

0.0.10 • Public • Published

aruba-instant

Introduction

Aruba Instant is a promise based library for node.js to interface via IAP's HTTP Swarm CGI Module

Dependencies

Compatibility

  • Tested against Aruba Instant 6.4.x.x
  • Node v7.2

Installation

yarn add aruba-instant

Usage

import Aruba from "aruba-instant";
import "console.table";

const config = {
  protocol: process.env.AICLI_PROTOCOL || "https",
  host: process.env.AICLI_HOST,
  port: process.env.AICLI_HOST || 4343,
  username: process.env.AICLI_USERNAME,
  password: process.env.AICLI_PASSWORD,
  apip: process.env.AICLI_APIP,
  useHTTPGetLogin: process.env.AICLI_HTTPGETLOGIN || false
};

function printShowResponse({data, tables}) {
  if (data) {
    Object.keys(data).forEach((k) => {
      console.log(`${k}: ${data[k]}`);
    });
  }
  if (tables) {
    tables.forEach((table) => {
      console.log(table.name);
      console.table(table.rows);
    });
  }
}

aruba.login().then(() => {
  return aruba.show(`show summary`).then(printShowResponse);
});

Debugging

This library uses debug for its logging, We prefix all logging entries with aruba-instant:

SET DEBUG=aruba-instant*

Readme

Keywords

none

Package Sidebar

Install

npm i aruba-instant

Weekly Downloads

2

Version

0.0.10

License

GPL-3.0

Last publish

Collaborators

  • azerothian