ibm-imam-cli

0.4.1 • Public • Published

README

ibm-imam-cli

Re-usable functions for interacting with Metadata Asset Manager via the command-line

Meta

  • license: Apache-2.0

createOrUpdateImportArea

Create or update an import area -- necessary before any tasks can be executed

Parameters

  • envCtx EnvironmentContext an environment context from ibm-iis-commons
  • name string name of the import area
  • description string description of the import area
  • bridgeName string name of the bridge to use for the import area
  • dcnParams Array<Object> array of data connection parameters (each object having an 'id', 'displayName', and 'value')
  • bridgeParams Array<Object> array of bridge-specific parameters (each object having an 'id', 'displayName', and 'value')

getImportAreaList

Get a list of import areas and their various last update dates

Parameters

  • envCtx EnvironmentContext an environment context from ibm-iis-commons

Returns Object an object with import area names as keys, and then within each of these a sub-object of timestamps 'importTS', 'analysisTS', 'previewTS', 'shareTS'

getTemplateForBridge

Returns a template (list of headers) for the bridge specified

Parameters

  • bridgeName string
  • wb Workbook? an optional workbook into which to add this template

Returns any Workbook an Excel Workbook with the template

buildParameterXML

Builds the parameter XML needed by imam.sh

Parameters

  • envCtx EnvironmentContext an environment context from ibm-iis-commons
  • filename string name of the XML file to produce
  • bridgeName string name of the bridge for which the XML file needs to be created
  • dcnParamList Array<Object> array of objects describing the data connection, each with 'id', 'displayName' and 'value' properties
  • paramList Array<Object> array of objects describing bridge-specific options, each with 'id', 'displayName', and 'value' properties

loadMetadata

Loads metadata from all of the sources listed in the specified Excel file -- which should have been produced first by the getTemplateForBridge function

Parameters

  • envCtx EnvironmentContext an environment context from ibm-iis-commons
  • filename string name of the .xlsx file containing host details, credentials, etc
  • callback processCallback callback that handles the response of processing

getColumnDefinitionsFromDDL

Given DDL for defining one or more database tables, converts these into their corresponding IMAM-recognisable data formats

Parameters

  • ddlFile string path to the DDL file containing one or more CREATE TABLE statements

Returns any FieldDefinitions with table names as keys, each being a sub-object with a 'header' (String) and 'columns' (String[]) properties

getHeaderLineForTable

Retrieves the header line for a given table name, from a set of converted field definitions

Parameters

  • tablesToFields FieldDefinitions the set of converted field definitions from getColumnDefinitionsFromDDL
  • tblName string the name of the table for which to get the header line
  • delimiter string? an optional delimiter to use (by default a |)

Returns any String with the header line for a data file that will be IMAM-importable

getOSHSchemaForTable

Creates the contents for an OSH schema file for a given table name, from a set of converted field definitions

Parameters

  • tablesToFields FieldDefinitions the set of converted field definitions from getColumnDefinitionsFromDDL
  • tblName string the name of the table for which to create the OSH schema file
  • delimiter string? an optional delimiter to use (by default a |)
  • bHeader boolean? true if there is a header in the data file, false otherwise
  • escape string? the string that should be treated as an escape sequence for the delimiter (e.g. a double-quote)

Returns any String with the contents for an OSH schema file that will be IMAM-importable

processCallback

This callback is invoked as the result of processing an Excel file.

Type: Function

Parameters

  • result Object the result object, as returned by module:shelljs~exec
  • bridgeName string name of the metadata bridge used for the load
  • dcnParams Array<Object> array of data connection parameter objects that were used to load metadata, each with an 'id', 'displayName' and 'value'
  • bridgeParams Array<Object> array of bridge-specific parameter objects that were used to load metadata, each with an 'id', 'displayName' and 'value'

BridgeFactory

BridgeFactory class -- for encapsulating information about metadata bridges and creating them when requested

getImplementedBridges

Retrieves a list of the bridges that can currently be handled by this module

Returns Array<string> a list of the bridge names that are currently implemented in the module

FileSchemaFactory

FileSchemaFactory class -- for encapsulating information about creating a schema heading for files

ImportParameters

ImportParameters class -- for encapsulating parameters for creating an import area in IMAM

getImportParametersDoc

Retrieve the ImportParameters document

addParameter

Add the specified parameter to the import

Parameters

addDataConnection

Add the specified data connection parameters to the import

Parameters

  • dcnParamsList Array<Object> an array of objects, each object having an 'id', 'displayName' and 'value'

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.1
    1
    • latest

Version History

Package Sidebar

Install

npm i ibm-imam-cli

Weekly Downloads

1

Version

0.4.1

License

Apache-2.0

Last publish

Collaborators

  • cgrote