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

cloudgenix

v1.1.4

Published

CloudGenix Controller SDK

Downloads

14

Readme

CloudGenix Controller SDK in Javascript for NodeJS

NodeJS software development kit and test application for the CloudGenix Controller.

Help or Feedback

For issues, please contact [email protected] or open a support ticket with [email protected]. We can also be found on the NetworkToCode Slack #cloudgenix channel at http://slack.networktocode.com.

Before You Begin

The CloudGenix Controller is only accessible to CloudGenix customers with a valid login using an IP address that has been whitelisted. Please contact us at one of the aforementioned methods if you need to have your IP addresses whitelisted.

New in v1.1.3

  • Support for Events API v3.1, which includes the acknowledgeEvent(event) API and support for adding include_acknowledged: [bool] to query in getEvents(query)

Quickstart

Refer to the Test.js file for a full examination of consuming the SDK. The SDK can be initialized and instantiated rather quickly:

// start the environment
$ npm install cloudgenix
$ node

// include the SDK
> CgSdk = require("cloudgenix");
[Function: CloudGenixSdk]

// create default success and failure handlers for enumeration
> function success(result) { console.log("Success: " + result); };
undefined
> function failure(err) { console.log("Error: " + err); };
undefined 

// initialize the SDK and login
// email, password, staticToken, debug
> sdk = new CgSdk("[email protected]", "[email protected]", null, false);
> sdk.login().then(success, failure);

// perform your first API call
> sdk.getSites().then(success, failure); 
> Data: {"_etag":0,"_content_length":"3173","_schema":0,"_created_on_utc":0,"_updated_on_utc":0,"_status_code":"200","_request_id":"1513104977242013899996721814543863209018","count":5,"items":[{"id":"14124967418110176", ...

// some APIs allow you to retrieve an object by its ID
> sdk.getSites("[site_id]").then(success, failure); 
> Data: {"id":"14124967418110176","_etag":11,"_content_length":"659","_schema":2,"_created_on_utc":14124967418110177,"_updated_on_utc":15111302532530128,"_status_code":"200","_request_id":"1516730421562008900000023387484663434125",...

// and another...
> sdk.getSiteTopology("[site_id]").then(success, failure);
> Data: {"type":"basenet","nodes":[{"id":"14124967418110176","_etag":0,"_content_length":"8107","_schema":0,"_created_on_utc":14124967418110177,"_updated_on_utc":0,"_status_code":"200","_request_id":"1513105335429012499995707288186023842012","tenant_id":"101","type":"SITE","name":"Atlanta DC","location":{"longitude":-84.39019775390625, ...

Queries

Queries must be constructed manually prior to calling APIs for flows, top N, events, or metrics data. Refer to the developer documentation for the structure for queries required for each different type.

topnQuery = {};
topnQuery["topn_basis"] = "traffic_volume";
topnQuery["top_n"] = { "type": "app", "limit": 10 };
topnQuery["filter"] = { "site": [ "[site_id]" ] };
topnQuery["start_time"] = "2017-12-01T00:00:00.000Z";
topnQuery["end_time"] = "2017-12-07T00:00:00.000Z";
sdk.getTopN(topnQuery, cb);

Execution in the Browser

We have tested the SDK with Browserify (http://browserify.org/) and it worked well.

Version History

Notes from previous versions (starting with v1.0.0) will be moved here.

v1.x

  • Initial release
  • Support for Javascript promise
  • Added optional 'id' parameter to several methods (for instance, to retrieve only an individual site, element, etc)
  • Various fixes
  • SAML login support via samlLoginStart() and samlLoginFinish()
  • Support for authentication with static auth tokens (use loginWithToken()).
  • Support for ESP/MSP login, use getClients() followed by emulateClient(id).