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 🙏

© 2026 – Pkg Stats / Ryan Hefner

intersight-rest

v1.4.5

Published

Cisco Intersight NodeJS REST Module

Readme

intersight-rest

Cisco has released their new Intersight platform for managing UCS Server and Hyperflex Hyperconverged infrastructure from a SaaS based interface. With high security standards, forming and signing the RESTful API calls to Intersight can be a challenge, so this package was written to do all of that work for you. All you need to provide is your Public/Private keys generated from the Intersight interface, as well at the API endpoint you'd like to target. Optionally you can add in query parameters for GET requests, and a body for POST/PATCH opterations.

Overview:

intersightREST(<options>);

| Option | Format | Value | | ------ | ------ | ------ | | httpMethod | <String> | HTTP Verb [ GET | POST | PATCH | DELETE ] | | resourcePath | <String> | Resource Path from https://intersight.com/apidocs | | queryParams | <Object> | Query Parameters from Resource Path GET | | body | <Object> | Body Parameters from Resource Path POST| | moid | <String> | MOID of Object to be Modified | | name | <String> | Name of Object to be Modified (See Notes) | | proxy | <String> | Proxy Server Address [ proto://<address>:<port> ] |

1 name will be ignored if moid is set.
2 name is case sensitive.

More information about Intersight is available at: https://intersight.com
Details on the RESTful API and documentation: https://intersight.com/apidocs

NPM Installation:

$ npm install --save intersight-rest

Usage:

// Import "intersight-rest" Package
const isREST = require('intersight-rest');

// Load Public/Private Keys
const fs = require('fs');
isREST.setPublicKey(fs.readFileSync('./keys/public_key.txt', 'utf8'));
isREST.setPrivateKey(fs.readFileSync('./keys/private_key.pem', 'utf8'));

// Select Resource Path from https://www.intersight.com/apidocs
const resourcePath = '/ntp/Policies';

// GET EXAMPLE
/* Set GET Options */
options = {
    httpMethod: 'get',
    resourcePath: resourcePath,
    queryParams: queryParams
};

/* Send GET Request */
isREST.intersightREST(options).then(response => {
    console.log(response.toJSON().body);
}).catch(err => {
    console.log('Error: ', err);
});

/* NOTE: intersightREST Returns a JS Promise */

// GET "queryParams" Examples
/* Example queryParams returning the top 1 result(s) */
queryParams = {
    "$top": 1
};

/* Example queryParams showing filter by "Name" key */
queryParams = {
    "$filter": "Name eq 'Test-NTP'"
};

/* Example queryParams showing filter by "Description" key */
queryParams = {
    "$filter": "Description eq 'pool.ntp.org'"
};

/* Example queryParams showing advanced Tag filder by key & value */
queryParams = {
    "$filter": "Tags/any(t: t/Key eq 'loc' and t/Value eq 'California')"
};

// POST EXAMPLE
/* Assemble POST Body */
postBody = {
    Name: "Test-NTP",
    Description: "Test NTP Policy",
    NtpServers: ["8.8.8.8"]
};

/* Set POST Options */
options = {
    httpMethod: 'post',
    resourcePath: resourcePath,
    body: postBody
};

/* Send POST Request */
isREST.intersightREST(options).then(response => {
    console.log(response.toJSON().body);
}).catch(err => {
    console.log('Error: ', err);
});

/* NOTE: intersightREST Returns a JS Promise */

// PATCH EXAMPLE
/* Assemble PATCH Body */
patchBody = {
    NtpServers: ["10.10.10.10"]
};

/* Option #1: PATCH by Object MOID */

/* Set Object MOID to be Modified */
patchMoid = '6b1727fa686c873463b8163e';

/* Set PATCH Options */
options = {
    httpMethod: 'patch',
    resourcePath: resourcePath,
    body: patchBody,
    moid: patchMoid
};

/* Option #2: PATCH by Object NAME */

/* Set Object NAME to be Modified */
patchName = 'Test-NTP';

/* Set PATCH Options */
options = {
    httpMethod: 'patch',
    resourcePath: resourcePath,
    body: patchBody,
    name: patchName
};

/* Send PATCH Request */
isREST.intersightREST(options).then(response => {
    console.log(response.toJSON().body);
}).catch(err => {
    console.log('Error: ', err);

/* NOTE: intersightREST Returns a JS Promise */

// DELETE EXAMPLE
/* Option #1: DELETE by Object MOID */

/* Set Object MOID to be Deleted */
deleteMoid = '6b1727fa686c873463b8163e';

/* Set DELETE Options */
options = {
    httpMethod: 'delete',
    resourcePath: resourcePath,
    moid: deleteMoid
};

/* Option #2: DELETE by Object NAME */

/* Set Object NAME to be Deleted */
deleteName = 'Test-NTP';

/* Set DELETE Options */
options = {
    httpMethod: 'delete',
    resourcePath: resourcePath,
    name: deleteName
};

/* Send DELETE Request */
isREST.intersightREST(options).then(response => {
    console.log(response.statusCode);
}).catch(err => {
    console.log('Error: ', err);

/* NOTE: intersightREST Returns a JS Promise */

See package source for more details...

*Copyright (c) 2018 Cisco and/or its affiliates.