Socket
Socket
Sign inDemoInstall

airvantage

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airvantage

AirVantage API client for nodejs


Version published
Maintainers
1
Created
Source

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

  • querySystems

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • getDetailsSystem

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • createSystem

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • editSystem

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • deleteSystem(uid)

    • uid
      • Required
      • Type: string
  • deleteSystems(options)

    • options
      • Type: object
      {
          "selection" : {
              "label": "aLabel",
              // Or
              "uids" : ["uid1", ...]
          },
          "deleteGateway": false | true,
          "deleteSubscriptions": false | true
      }
      
  • activateSystems

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • suspendSystems

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • resumeSystems

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • terminateSystems

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • queryMultiRawDataPoints

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

Gateways

  • queryGateways

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • getDetailsGateway

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • createGateway

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • editGateway

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • deleteGateway(uid)

    • uid
      • Required
      • Type: string
  • deleteGateways(options)

    • options
      • Type: object
      {
          "selection" : {
              "label": "aLabel",
              // Or
              "uids" : ["uid1", ...]
          }
      }
      

Subscriptions

  • querySusbscriptions

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • getDetailsSubscription

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • createSusbscription

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • editSusbscription

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • deleteSusbscription(uid)

    • uid
      • Required
      • Type: string
  • deleteSusbscription(options)

    • options
      • Type: object
      {
          "selection" : {
              "label": "aLabel",
              // Or
              "uids" : ["uid1", ...]
          }
      }
      
  • activateSusbscriptions

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • synchronizeSusbscriptions

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • suspendSusbscriptions

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • restoreSusbscriptions

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • terminateSusbscriptions

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

Applications

  • queryApplications

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • getDetailsApplication

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • createApplication

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • editApplication

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • editApplicationCommunication(uid, data)

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • editApplicationData(uid, data)

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • releaseApplication(filePath)

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • publishApplication(uid)

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • addApplication(uid)

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • deleteApplication(uid)

    • uid
      • Required
      • Type: string
  • deleteApplications(options)

    • options
      • Type: object
      {
          "selection" : {
              "label": "aLabel",
              // Or
              "uids" : ["uid1", ...]
          }
      }
      

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

  • queryOperations

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

  • getDetailsOperation

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

Misc

  • currentUser

See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

Keywords

FAQs

Package last updated on 07 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc