1.0.2 • Published 3 years ago

node-zebrix-client v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Zebrix for Node.js

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);
    });
});

Installation

npm install node-zebrix-client

Run tests

This test suite connects to the real API, so no mocking.

ZEBRIX_CLIENT=xxxx ZEBRIX_USERNAME=yyyy ZEBRIX_PASSWORD=zzz npm run test

Requests

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);
1.0.2

3 years ago

1.0.1

5 years ago

1.0.0

5 years ago