1.2.0 • Published 8 years ago

refocus-client v1.2.0

Weekly downloads
6
License
ISC
Repository
github
Last release
8 years ago

Coverage Status

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

8 years ago

1.1.0

8 years ago

1.0.25

9 years ago

1.0.24

9 years ago

1.0.23

9 years ago

1.0.22

9 years ago

1.0.21

9 years ago

1.0.20

9 years ago

1.0.19

9 years ago

1.0.18

9 years ago

1.0.17

9 years ago

1.0.16

9 years ago

1.0.15

9 years ago

1.0.14

9 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago