ibm-imam-cli v0.4.1
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
envCtxEnvironmentContext an environment context from ibm-iis-commonsnamestring name of the import areadescriptionstring description of the import areabridgeNamestring name of the bridge to use for the import areadcnParamsArray<Object> array of data connection parameters (each object having an 'id', 'displayName', and 'value')bridgeParamsArray<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
envCtxEnvironmentContext 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
bridgeNamestringwbWorkbook? 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
envCtxEnvironmentContext an environment context from ibm-iis-commonsfilenamestring name of the XML file to producebridgeNamestring name of the bridge for which the XML file needs to be createddcnParamListArray<Object> array of objects describing the data connection, each with 'id', 'displayName' and 'value' propertiesparamListArray<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
envCtxEnvironmentContext an environment context from ibm-iis-commonsfilenamestring name of the .xlsx file containing host details, credentials, etccallbackprocessCallback 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
ddlFilestring 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
tablesToFieldsFieldDefinitions the set of converted field definitions from getColumnDefinitionsFromDDLtblNamestring the name of the table for which to get the header linedelimiterstring? 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
tablesToFieldsFieldDefinitions the set of converted field definitions from getColumnDefinitionsFromDDLtblNamestring the name of the table for which to create the OSH schema filedelimiterstring? an optional delimiter to use (by default a |)bHeaderboolean? true if there is a header in the data file, false otherwiseescapestring? 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
resultObject the result object, as returned by module:shelljs~execbridgeNamestring name of the metadata bridge used for the loaddcnParamsArray<Object> array of data connection parameter objects that were used to load metadata, each with an 'id', 'displayName' and 'value'bridgeParamsArray<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
idstringdisplayNamestringvaluestringlocationNode? the XML location at which to add the parameter
addDataConnection
Add the specified data connection parameters to the import
Parameters