0.0.2 • Published 5 years ago
avmsa-group-api-amqp v0.0.2
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];
}
}
});
2. API Reference
listDevices
Callback
listDevices(function(err, devices){ ... })
addDevice
Callback
addDevice(devId, function(err, authKey){ ... })
listFiles
Callback
listFiles(devId, function(err, files){ ... })
uploadScript
Callback
uploadScript(devId, path, function(err, message){ ... })
uploadConfig
Callback
uploadConfig(devId, path, function(err, message){ ... })
uploadDfuPackage
Callback
uploadDfuPackage(devId, path, function(err, message){ ... })
updateAuthKey
Callback
updateAuthKey(devId, function(err, authKey){ ... })
removeDevice
Callback
removeDevice(devId, function(err, message){ ... })