0.0.2 • Published 5 years ago

avmsa-group-api-amqp v0.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Avimesa Group API Node Package

Node.js SDK for the Avimesa Group API using AMQP (0-9-1)

Introduction

This project the source code for the avmsa-group-api-amqp npm package. The Avimesa Group API is documented here in detail.

Table of Contents

1. Quick Start

Install the package:

npm install avmsa-group-api-amqp

Update or add your .env file in the project root:

# RMQ Server Hostname
RMQ_HOSTNAME=rmqserv001.avimesa.com

# RMQ Server Port
RMQ_PORT=5671

# RMQ Group ID / Vhost
RMQ_GROUP_ID= ** TODO **

# RMQ Authentication Key
RMQ_AUTH_KEY= ** TODO **

# Set this to 0 to allow certless TLS
NODE_TLS_REJECT_UNAUTHORIZED=0

Load the package:

...
const api = require('group-api-amqp');
...

Use API per documentation, for example, listing Devices for the Group:

api.listDevices(function(err, devices){
    if(!err){
        for (i = 0; i < devices.length; i++){
            console.log(devices[i];
        }
    }
});

Top

2. API Reference

listDevices

Callback

listDevices(function(err, devices){ ... })

Top

addDevice

Callback

addDevice(devId, function(err, authKey){ ... })

Top

listFiles

Callback

listFiles(devId, function(err, files){ ... })

Top

uploadScript

Callback

uploadScript(devId, path, function(err, message){ ... })

Top

uploadConfig

Callback

uploadConfig(devId, path, function(err, message){ ... })

Top

uploadDfuPackage

Callback

uploadDfuPackage(devId, path, function(err, message){ ... })

Top

updateAuthKey

Callback

updateAuthKey(devId, function(err, authKey){ ... })

Top

removeDevice

Callback

removeDevice(devId, function(err, message){ ... })

Top