1.2.0 • Published 6 years ago
refocus-client v1.2.0
refocus-client
Interact with the Refocus API using refocus-client
and Bluebird promises.
Install
npm install refocus-client --save
Usage
const RefocusClient = require('refocus-client');
// Some configuration
const refocusUrl = 'http://localhost:3000'; // The URL where Refocus is running
const apiVersion = 'v1'; // The Refocus API version
const token = 'skqjkbqkjnq9n34jn3jk3fjnwefwefwef34'; // Your API token
// Instantiate the RefocusClient.
const rc = new RefocusClient(refocusUrl, apiVersion, token);
// Now use the RefocusClient API. For example, here we create a new Aspect:
rc.addAspect({
name: 'Latency',
isPublished: true,
timeout: '5m',
valueType: 'NUMERIC',
valueLabel: 'ms',
criticalRange: [500, 999999999999],
warningRange: [300, 500],
infoRange: [200, 300],
okRange: [0, 200],
})
.then((asp) => {
// Do something else now that the aspect has been created?
console.log(`Created "${asp.name}"`);
})
.catch((err) => {
// Handle errors...
console.log('Uh oh!', err);
});
Proxy
If you need to specify a proxy for communication to Refocus, set environment variable "http_proxy".
API
1.2.0
6 years ago
1.1.0
6 years ago
1.0.25
7 years ago
1.0.24
7 years ago
1.0.23
7 years ago
1.0.22
7 years ago
1.0.21
7 years ago
1.0.20
7 years ago
1.0.19
7 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago