IBM/node-infosvr-commons

Name: node-infosvr-commons

Owner: International Business Machines

Description: Re-usable functions and utilities for interacting with IBM Information Server.

Created: 2018-05-14 15:49:30.0

Updated: 2018-05-21 14:57:13.0

Pushed: 2018-05-21 14:57:16.0

Homepage: https://www.npmjs.com/package/ibm-iis-commons

Size: 44

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

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:

 ./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:

=isadmin
word=
in=is-server.ibm.com:9445
er=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

Examples

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

Sets up a REST API connection

Parameters

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

Examples

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

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

Parameters

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

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

authFile

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

Returns string

authFile

Set the location of the authorisation file

Parameters

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

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

Parameters

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.