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

ibm-iis-commons

v0.7.3

Published

Re-usable functions for inferring properties of and interacting with an IBM InfoSphere Information Server environment

Downloads

17

Readme

README

Objective of this module is to provide re-usable functionality and utilities for interacting with an IBM Information Server environment using NodeJS.

Utilities

createInfoSvrAuthFile.js

Creates an authorisation file for use with connecting to an Information Server environment. Usage:

node ./createInfoSvrAuthFile.js
	-u <user>
	[-f <file>]
	[-p <password>]

By default (if not specified using the optional parameters), will create a file under ~/.infosvrauth and will prompt the user to enter the password on the command-line. The utility makes use of Information Server's encrypt.sh script, so this should be run from an Information Server node (a tier with .../ASBNode/bin/encrypt.sh). Once created, the authorisation file can then be copied to any other system and used from any other system to provide the connectivity details necessary to connect remotely to the Information Server environment.

If executing the script on the Information Server system itself is not an option, but you still want to create an authorisation file, your best bet is to manually create one using the following format:

user=isadmin
password=
domain=is-server.ibm.com:9445
server=IS-SERVER.IBM.COM

The password can be left blank (most utilities that make use of this authorisation file request the password to be provided separately anyway, either as another parameter or via a command-line prompt). Ensure, however, that the domain property refers to the correct FQDN of your domain-tier host as well as the port, and that the server property refers to your engine tier's FQDN.

API

ibm-iis-commons

Re-usable functions for inferring properties of and interacting with an IBM InfoSphere Information Server environment

RestConnection

RestConnection class -- for handling connectivity to REST APIs

Parameters

  • username
  • password
  • host
  • port
  • maxSockets

Examples

const commons = require('ibm-iis-commons');
const restConnect = new commons.RestConnection('isadmin', 'isadmin-password', 'localhost', '9445');
const igcrest = require('ibm-igc-rest');
igcrest.setConnection(restConnect);

constructor

Sets up a REST API connection

Parameters

  • username string username to use when authenticating to REST API
  • password string password to use when authenticating to REST API
  • host string hostname of the domain tier
  • port int port number of the domain tier
  • maxSockets int? the maximum number of sockets to support concurrently on the host

auth

Get the authentication object for a REST connection

Returns Object a hash of 'user' and 'pass' basic authentication details

host

Get the hostname for the REST connection

Returns string

port

Get the port for the REST connection

Returns string

connection

Get the qualified connection details for the REST connection (host:port)

Returns string

baseURL

Get the fully-qualified base SSL URL for the REST connection

Returns string

agent

Get the https.Agent object for the REST connection

Returns Object

sessionStatus

Retrieves indication of whether a session is open (true) or not (false)

Returns boolean

markSessionOpen

Marks that a session has been opened

markSessionClosed

Marks that the session has been closed

EnvironmentContext

EnvironmentContext class -- for encapsulating the context of an Information Server environment (NOTE: always run from Engine tier)

Parameters

  • installLocation
  • authFile

Examples

const commons = require('ibm-iis-commons');
const envCtx = new commons.EnvironmentContext();
console.log("Host details: " + envCtx.domainHost + ":" + envCtx.domainPort);
console.log("Version     : " + envCtx.currentVersion);
console.log("Patches     : " + envCtx.installedPatches);
console.loc("$DSHOME     : " + envCtx.dshome);

constructor

Sets up everything we can determine about the environment from the current system

Parameters

  • installLocation string? specifies the root of the installation ('/opt/IBM/InformationServer' by default)
  • authFile string? specifies the location of an authorisation file from which information can be retrieved (if available)

ishome

Get the installation location of Information Server

Returns string

dshome

Get the installation location of DataStage

Returns string

asbhome

Get the installation location of the ASBNode

Returns string

istool

Get the fully-qualified location of the istool command

Returns string

currentVersion

Get the version of the Information Server installation

Returns string

installedPatches

Get an array of installed patches on the Information Server environment

Returns Array<string>

domainHost

Get the hostname of the Information Server domain (services) tier

Returns string

domainPort

Get the port number of the Information Server domain (services) tier

Returns string

domain

Get fully-qualified Information Server domain (services) tier information -- host:port

Returns string

engine

Get the hostname of the Information Server engine tier

Returns string

createAuthFileFromParams

Creates an authorisation file that can be used with most Information Server CLI tools (so that passwords are not shown in-the-clear on the command line) -- based on the values provided NOTE: this must be run from the Information Server environment directly (cannot be run remotely)

Parameters

  • username string username to use for authentication
  • password string password to use for authentication
  • file string file into which to store the details

addRemoteConnectionDetailsToAuthFile

Adds remote connection details to an existing authorisation file, that can then be used for connecting to an Information Server system remotely (requires SSH and key-based authentication to be pre-configured, or a local Docker container)

Parameters

  • file string authorisation file into which to append the remote connection details
  • accessType string type of access, either DOCKER or SSH
  • username string OS username used for remote access
  • privateKey string SSH private key file used for authentication
  • hostOrContainer string hostname (or IP) of the remote Information Server system (when accessType is SSH), or container name (when accessType is DOCKER)
  • port string? SSH port number for the remote Information Server system

authFile

Get the fully-qualified location of the authorisation file (if any)

Returns string

authFile

Set the location of the authorisation file

Parameters

  • file {string}

username

Get the username, from the authorisation file if needed

Returns string

password

Get the user's password, from the authorisation file if needed

Returns string

remoteConnectionString

Get the remote connection string, from the authorisation file if needed

Returns string

remoteCopyString

Get the remote copy string, from the authorisation file if needed

Returns string

getRestConnection

  • See: module:ibm-iis-commons~RestConnection

Get a RestConnection object allowing REST API's to connect to this environment

Parameters

  • password string unencrypted password to use for REST connection (other details taken from authorisation file automatically)
  • maxSockets int? the maximum number of sockets to support concurrently on the host

Returns RestConnection

runInfoSvrCommand

Run the provided command on the Information Server environment

Parameters

copyFile

Copy the provided source file to the target location on the Information Server environment

Parameters

removeFile

Remove the specified file from the Information Server environment

Parameters