esi-deploy

Dependencies

library version inmation core library

esi-ntservice

1.70.7

yes

esi-string

1.60.7

yes

Available functions

Documentation

RENAME_CORE()

Rename Core object to 'Core' (common design pattern)

ADD_DEFAULT_CONNECTOR()

Add localhost Connector to Core (passive)

ENABLE_DEFAULT_OPCSERVER(opcServerName)

Inmation OPC Server will be enabled with UA objects

Parameters

opcServerName

Name for inmation OPC Server object in Server Model

Usage

(require "esi-deploy"):ENABLE_DEFAULT_OPCSERVER("OPCServer-Global-Interface01")

ENABLE_DEFAULT_WEBAPISERVER(WebAPIServerName,WebAPIPort,UseSSL)

Inmation WebAPI Server will be enabled

Parameters

WebAPIServerName

Name for inmation WebAPI Server object in Server Model.

WebAPIPort

TCP port that Web API service will listen on. Default is 8002.

UseSSL

Default nil for HTTP binding; set true for the Web API endpoint to use https://…​; endpoint. Note: this requires a certificate binding on the WebAPIPort.

Usage

(require "esi-deploy"):ENABLE_DEFAULT_WEBAPISERVER("WebAPIServer-Global-Interface01")

INIT_INTSERVER(args)

Initialise the Interface Server objects based on naming conventions (SERVERTYPE-SHORTCODE-EXTENSION1\{-EXTENSION2})

Parameters

shortCode

Shortcode for Core (used in Server names)

extension1

Extension1 parameter in Server name

extension2

Extension2 parameter in Server name (optional)

port
  TCP port that Web API service will listen on. Default is 8002.
SSL
   Default nil for HTTP binding; set true for the Web API endpoint to use an https://... endpoint. Note: requires certificate binding on the WebAPIPort.

Usage

(require "esi-deploy"):INIT_INTSERVER({
shortCode = "SITE",
extension1 = "Interface01",
})

INIT_CONNECTOR(args)

Initialize Connector object according to naming convention (SHORTCODE-EXTENSION1\{-EXTENSION2})

Parameters

shortCode

Shortcode for Core (prefix in Connector name)

extension1

Extension1 parameter in Connector name

extension2

Extension2 parameter in Connector name (optional)

connectorHost

Hostname for Connector

hasLocalCore

If not nil, this Connector will be created below a Local-Core (according to shortcode)

hasCoreRelay1

If not nil, a Relay object exists between Master- and Local-Core

hasCoreRelay2

If not nil, a second Relay object exists between Master- and Local-Core

hasConnectorRelay1

If not nil, a Relay object exists between this Connector and the Core

hasConnectorRelay2

If not nil, a second Relay object exists between this Connector and the Core

forceCorePath

If set, the has…​ parameters will be ignored. Instead the forceCorePath is used as parent path for the Connector object. Default is nil.

Usage

-- Creating a Connector directly below a local core, which is connected to the master core via a relay
(require "esi-deploy"):INIT_CONNECTOR({
shortCode = "SITE",
extension1 = "LineA",
connectorHost = "D-SITE-Conn-A",
hasLocalCore = 1,
hasCoreRelay1 = 1
})

INIT_RELAY(args)

Initialize Relay object according to naming convention (SHORTCODE-RELAY\{-INSTANCE})

Parameters

shortCode

Shortcode for Core (prefix in Relay name)

instanceNumber

instance number of the Relay; if defined this is assumed to be one of a Relay pair, if nil there is just a single Relay

relayHost

Hostname for Relay (server DNS name or IP address)

hasLocalCore

If not nil, Relay(s) may already exist between Master and Local-Core (according to shortcode); the Relay will be created beneath the Local-Core

hasCoreRelay1

If not nil, a Relay object already exists between Master- and Local-Core

hasCoreRelay2

If not nil, a second Relay object already exists between Master- and Local-Core

Usage

-- Creating a Relay-object below a Master-Core
(require "esi-deploy"):INIT_RELAY({
shortCode = "SITE",
relayHost = "D-SITE-Relay-1",
})

-- Creating a Relay-object below a Local-Core, that itself exists below a Relay
(require "esi-deploy"):INIT_RELAY({
shortCode = "SITE",
relayHost = "D-SITE-Relay-1",
hasLocalCore = 1,
hasCoreRelay1 = 1
})

INIT_LOCALCORE(args)

Initialize Local-Core object according to naming convention

Parameters

shortCode

Shortcode for Core (prefix in Relay name)

coreHost

Hostname for Local-Core server

corePort

TCP listener port for Local-Core service (default 6512)

hasCoreRelay1

If not nil, a Relay object exists between Master- and Local-Core

hasCoreRelay2

If not nil, a second Relay object exists between Master- and Local-Core

Usage

(require "esi-deploy"):INIT_LOCALCORE({
shortCode = "SITE",
coreHost = "D-SITE-Core",
hasCoreRelay1 = 1
})

INIT_MONGODB_PSS(args)

Initialize MongoDB replicaset with custom datastores according to naming convention. Random password will be generated.

Parameters

PrimaryHost

Hostname for the primary replicaset instance

SecondaryHost1

Hostname for the secondary (1) replicaset instance

SecondaryHost2

Hostname for the secondary (2) replicaset instance

ShortCode

Shortcode for Core, used for Connectors and Customstores. Default is 'Global'.

IsLocalCore

If set to true, the ShortCode parameter will be used to find a Local-Core object. If not set (nil), the Master-Core will be used. Connectors and Customstores will be created below this Core object.

UserName

Username for MongoDB connection. Default is dbadmin.

PrimaryPort

TCP listener port for the primary replicaset instance. Default is 27017.

SecondaryPort1

Hostname for the secondary (1) replicaset instance. Default is 27017.

SecondaryPort2

Hostname for the secondary (2) replicaset instance. Default is 27017.

RetentionTimeNonGxpDays

RetentionTime for data in the NonGxp datastore, in days. Default is 365.

RetentionTimeGxpDays

RetentionTime for data in the Gxp datastore, in days. Default is 365.

Usage

-- Initialize MongoDB replicaset objects for Master-Core
(require "esi-deploy"):INIT_MONGODB_PSS({
PrimaryHost = "D-GXPC-RepA",
SecondaryHost1 = "D-GXPC-RepB",
SecondaryHost2 = "D-GXPC-RepC",
RetentionTimeNonGxpDays = 365,
RetentionTimeGxpDays = 365
})

-- Initialize MongoDB replicaset objects for Local-Core 'SITE'
(require "esi-deploy"):INIT_MONGODB_PSS({
PrimaryHost = "D-GXPC-RepD",
SecondaryHost1 = "D-GXPC-RepE",
SecondaryHost2 = "D-GXPC-RepF",
ShortCode = "SITE",
IsLocalCore = true,
RetentionTimeNonGxpDays = 365,
RetentionTimeGxpDays = 365
})

INIT_BACKUP_LOGIC(args)

Initialize backup logic under the given component path

Parameters

ioPath

The path for the backup logic folder to be put in io Model

diskPath

The file path where the backup will be stored (e.g. C:/inmation.root/backup)

retentionMode

The mode decides over how long backups are keps - e.g. WEEKLY mode keeps daily backups of the last 7 days - There is lib.BackupRetentionMode.WEEKLY and DAILY (DAILY is the default)

Usage

local DEP = require "esi-deploy"
DEP:INIT_BACKUP_LOGIC({
ioPath = "/System/Core/Core Logic",
diskPath = "C:/inmation.root/backup",
retentionMode = DEP.BackupRetentionMode.WEEKLY,
})

CREATE_HEALTHMONITOR(args)

Initialize health monitor objects

Parameters

kpiPath

The path for the KPI model group object. Default is empty string.

GET_PRODUCT_KEY(args)

Return product key information.

Usage

local DEP = require "esi-deploy"
return DEP:GET_PRODUCT_KEY()