4.0.0 • Published 9 years ago

airvantage v4.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

AirVantage.js

Nodejs AirVantage API client

Build Status

Full AirVantage API documentation: https://doc.airvantage.net/av/reference/cloud/API/

Install

:warning: Node.js 4 or higher is required for airvantage@3 and above. For older Node.js versions use airvantage@2.

$ npm install --save airvantage

Usage

const AirVantage = require("airvantage");

const config = {
    serverUrl: "https://eu.airvantage.net", // or https://na.airvantage.net
    credentials: {
        client_id: "YOUR_CLIENT_ID",
        client_secret: "YOUR_CLIENT_SECRET",
        username: "you@domain.com",
        password: "yOuRs3cR3t!"
    }
};

const airvantage = new AirVantage(config);

airvantage
    .authenticate()
    .then(() => airvantage.querySystems({ labels: ["demo"] }))
    .then(systems => console.log("All demo systems:", systems));

You may already have an access_token and want to use it:

const AirVantage = require("airvantage");
const airvantage = new AirVantage({
    serverUrl: "https://eu.airvantage.net", // or https://na.airvantage.net
});

function querySystems(accessToken) {
    airvantage
        .authenticate({token: accessToken})
        .then(() => airvantage.querySystems({ labels: ["demo"] }))
        .then(systems => console.log("All demo systems:", systems));
}

OR you may want to authentication multiple users with a single AirVantage instance

const AirVantage = require("airvantage");
const airvantage = new AirVantage({
    serverUrl: "https://eu.airvantage.net", // or https://na.airvantage.net
});

function authenticate(username, password) {
    airvantage
        .authenticate({username: username, password: password})
        .then(token => storeToken(username, token));
}

Available methods

Systems

Gateways

Subscriptions

Applications

Alert Rules

  • createAlertRule(data)
  • editAlertRule(uid, data)
  • deleteAlertRule(uid)
  • deleteAlertRules(params)
  • queryAlertRules(params)
  • getDetailsAlertRule(id)

  • createNotificationHook(id, callback)

    Add a new notification hook when the given alert rule identifier is triggered. When a rule get trigged, the given callback is invoked See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • getNotificationHooks(id)

    Get the list of all notification hooks configured for the given alert rule identifier. See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

Operations

Misc

4.0.0

9 years ago

3.4.0

9 years ago

3.3.0

9 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.0

9 years ago

3.0.0

9 years ago

2.1.0

9 years ago

2.0.0

10 years ago

1.23.0

10 years ago

1.22.0

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago