1.2.0 • Published 7 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
7 years ago
1.1.0
7 years ago
1.0.25
8 years ago
1.0.24
8 years ago
1.0.23
8 years ago
1.0.22
8 years ago
1.0.21
8 years ago
1.0.20
8 years ago
1.0.19
8 years ago
1.0.18
8 years ago
1.0.17
8 years ago
1.0.16
8 years ago
1.0.15
8 years ago
1.0.14
8 years ago
1.0.13
9 years ago
1.0.12
9 years ago
1.0.11
9 years ago
1.0.10
9 years ago
1.0.9
9 years ago
1.0.8
9 years ago
1.0.7
9 years ago
1.0.6
9 years ago
1.0.5
9 years ago
1.0.4
9 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago