node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

knet-client

KNet Client

A client library to talk with KNet.

Initialising the KNet client

var KNetClient = require('knet-client');
 
var options = {
  "host": "knet.local"
, "username": "********"
, "password": "********"
};
 
knet = new KNetClient(options);

Avaliable commands

knet.listRoles(callback);
knet.listStrategies(callback);
knet.listSquadrons(callback);
knet.listDrones(callback);
knet.listMachines(callback);
 
knet.getRole(roleId, callback);
knet.getStrategy(strategyId, callback);
knet.getSquadron(strategyId, callback);
knet.getDrone(droneId, callback);
knet.getDroneStderrs(droneId, callback);
knet.getDroneStdouts(droneId, callback);
 
knet.upsertRole(roleId, data, callback);
knet.upsertStrategy(strategyId, data, callback);
 
knet.deleteRole(roleId, callback);
knet.deleteStrategy(strategyId, callback);
 
knet.decommissionDrone(droneId, callback);
knet.stopDrone(droneId, callback);

Example

knet.listRoles(function(err, res, roles) {
  // roles is an array of objects 
});