@metasys/nodekit
Metasys® Server REST API client for node.js
Last updated a year ago by michaelgwelch .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @metasys/nodekit 
SYNC missed versions from official npm registry.

nodekit

CircleCI

Metasys® Server REST API client for node.js

This library is used to consume the Metasys Server API. It currently supports V1 of the Metasys® Server API.

See Documentation for more information.

Installation

npm install @metasys/nodekit

Usage

The following example will log into the server, and fetch and print each alarm with a priority in the range of 0 to 10.

const { MetasysServerApi } = require('@metasys/nodekit');

async function main() {
  const api = new MetasysServerApi();
  await api.login('user', 'pass', 'host');

  const alarms = await api.alarms({ priorityRange: '0,10' });
  for await (const alarm of alarms) {
    console.log(JSON.stringify(alarm, null, 2));
  }
}

main();

Client Options

This library depends on request. You can pass an options argument as defined by request as the fourth parameter of the login method for any special options you need. These will be used on every future call made by the api.

For example, if you are using a self signed certificate on your Metasys Server, then the calls to the API may fail with certificate errors if your machine is not setup to trust the self-signed certificate.

The easiest way to handle this is to get the cert in a .pem format and then specify that certificate in your login method:

const fs = require('fs')
const ca = fs.readFileSync('./path/to/cert.pem');
const api = require('@metasys/nodekit');

async main() {
  await api.login('user', 'pass', 'host', { ca });
}

main()

See request for more options.

Current Tags

  • 2.0.0                                ...           latest (a year ago)

9 Versions

  • 2.0.0                                ...           a year ago
  • 2.0.0-2                                ...           a year ago
  • 2.0.0-1                                ...           a year ago
  • 2.0.0-0                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 2
This Month 2
Last Day 1
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (9)

Copyright 2014 - 2016 © taobao.org |