npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

moog-graze

v0.2.3

Published

Interact with MOOG.AIOps via Graze (REST)

Downloads

37

Readme

Moogsoft Logo

MOOG.AIOps Graze ReSTful Client for Node.js

Code Climate

Allows connecting to the MOOG.AIOps REST API (Called Graze) and interacting with the MOOG.AIOps platform.

  • Provides a simplified abstraction
  • Provides for automated authentication
  • Provides support for the latest v1 specification
  • Will handle auth failure and retry activity

Updated for MOOG.AIOps V6

Installation

$ npm install moog-graze

Usage

Create a connection

Create a connection to the Graze REST (You need a user with the Grazer role)

options is an object containing connection specific settings

// For Auth token
var graze = require('moog-graze')({hostname: 'moogtest','grazeUser':'my_user', 'grazePass':'my_password'});
// OR for Basic Auth
var graze = require('moog-graze')({hostname: 'moogtest','auth':'my_user:my_password'});

The use of TLS (https) is mandatory

To pass a server certificate pass the parameter options.cert in PEM format

To pass a client key use options.key as certificate in PEM format, you must also pass a server certificate.

To provide a ca certificate (self signed) or a ca as a valid root (some common root certificates are included)

To bypass root ca checking (insecure TLS/SSL for self signed) rejectUnauthorized: false


// Pass the options as an object on init
//
var graze = require('moog-graze')({hostname: 'moogtest'});

// Or set the options to your specific configuration.
//
graze.setOps({hostname: 'newtesthost',
    'auth': 'username:password',
    'caCert': '<a certificate in PEM format>',
    'cert': '<a certificate in PEM format>',
    'rejectUnauthorized': false
    });

// Get a copy of the current options 
//
var opts = graze.getOps();

Submit a request

Very simple to submit a request to a Graze endpoint


// example to get the detail for a situation.
//
graze.getSituationDetails(situationId,callback());

All callbacks provide err (http code) and data (payload or more error details)


graze.getSituationDetails(situationId, function (err, data) {
    if (err !== 200) {
        console.log('graze message sent, return code: ' + err);
        console.log('graze result: ' + data);
    } else {
        console.log('graze Situation details: ' + util.inspect(data));
    }
});

##Tests There are a set of Mocha tests that can be run against an instance, you will need a number of alets and situations and a team with name 'Cloud DevOps'.

For the new getAlertId, getSituationId and createMaintenanceWindow take a filter as an argument or as a paramter. This needs to be in MOOG internal filter format, e.g.

'{"op":6,"column":"internal_priority","type":"LEAF","value":[3,4,5]}'

##Updates 6.1.3

  • findMaintenaceWindows
  • deleteMaintanceWindows

6.1.0

  • Basic Auth
  • createTeam
  • updateTeam
  • createUser
  • teamObj prototype
  • userObj prototype

5.2.3

  • createMaintenanceWindow
  • getMaintenanceWindows
  • deleteMaintenanceWindow
  • maintenanceWindowObj prototype
  • setAlertAcknowledgeState
  • setSituationAcknowledgeState
  • setSituationExternalSeverity DEPRECATED

###TODO Add convertion of advanced query syntax to internal MOOG format. NOT required with new SQL like options (6.1.2).

##References For full details of the Graze API see http://docs.moogsoft.com/display/MOOG/Graze+API