knet-client

KNet client to talk with KNet

npm install knet-client
1 downloads in the last week
4 downloads in the last month

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
});
npm loves you