An client library for the Zebrix REST.
let Zebrix = require('node-zebrix-client');
let client = new Zebrix({
client: process.env.ZEBRIX_CLIENT,
username: process.env.ZEBRIX_USERNAME,
password: process.env.ZEBRIX_PASSWORD
});
client.login(function (data, error) {
// set the token
client.options.token = data.token;
// list the datasources
client.get('api/datasource', function(data, error) {
console.log(data);
});
});
npm install node-zebrix-client
This test suite connects to the real API, so no mocking.
ZEBRIX_CLIENT=xxxx ZEBRIX_USERNAME=yyyy ZEBRIX_PASSWORD=zzz npm run test
You now have the ability to make GET and POST requests against the API via the convenience methods.
client.get(path, body, callback);
client.post(path, body, callback);