Skip to content

Commit

Permalink
Enhance documentation & Update jar and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jvdot committed Apr 2, 2024
1 parent 6ffc5a0 commit 785a9b7
Show file tree
Hide file tree
Showing 37 changed files with 1,004 additions and 759 deletions.
2 changes: 1 addition & 1 deletion bin/cli.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ set IBM_SCADA_CONNECTOR_DATA_DIR=%MAS_SHC_HOME%

set CP=%MAS_SHC_HOME%\jre\lib\*;%MAS_SHC_HOME%\lib\*

%MAS_SHC_HOME%\jre\bin\java -classpath "%CP%" com.ibm.mas.scada.historian.connector.CLIClient "%1" "%2" "%3"
%MAS_SHC_HOME%\jre\bin\java -classpath "%CP%" com.ibm.mas.scada.historian.connector.processor.CLIClient "%1" "%2" "%3"

2 changes: 1 addition & 1 deletion bin/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export IBM_SCADA_CONNECTOR_DATA_DIR
CP="${MAS_SHC_HOME}/jre/lib/*:${MAS_SHC_HOME}/lib/*"
echo ${CP}

${MAS_SHC_HOME}/jre/bin/java -classpath "${CP}" com.ibm.mas.scada.historian.connector.CLIClient "$@"
${MAS_SHC_HOME}/jre/bin/java -classpath "${CP}" com.ibm.mas.scada.historian.connector.processor.CLIClient "$@"

4 changes: 2 additions & 2 deletions bin/configTask.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
# c:> powershell.exe -ExecutionPolicy Bypass .\bin\configTask.ps1
#

$InstallPath = "C:\ibm\masshc"
$DataPath = "C:\ibm\masshc"
$InstallPath = "C:\IBM\masshc"
$DataPath = "C:\IBM\masshc"

# Create Data dir
Write-Host "Creating Data directory $DataPath"
Expand Down
2 changes: 1 addition & 1 deletion bin/connector.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ set IBM_SCADA_CONNECTOR_DATA_DIR=%MAS_SHC_HOME%

set CP=%MAS_SHC_HOME%\jre\lib\*;%MAS_SHC_HOME%\lib\*

%MAS_SHC_HOME%\jre\bin\java -Djdk.internal.httpclient.disableHostnameVerification=true -classpath "%CP%" com.ibm.mas.scada.historian.connector.Connector
%MAS_SHC_HOME%\jre\bin\java -Djdk.internal.httpclient.disableHostnameVerification=true -classpath "%CP%" com.ibm.mas.scada.historian.connector.Connector %1 %2 %3

7 changes: 6 additions & 1 deletion bin/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ if(!(Test-Path $DataPath))
New-Item -Path "$DataPath\volume\config" -ItemType Directory
New-Item -Path "$DataPath\volume\data" -ItemType Directory
}

elseif(!(Test-Path "$DataPath\volume"))
{
New-Item -Path "$DataPath\volume\logs" -ItemType Directory
New-Item -Path "$DataPath\volume\config" -ItemType Directory
New-Item -Path "$DataPath\volume\data" -ItemType Directory
}

# Set Environment variables
[System.Environment]::SetEnvironmentVariable('IBM_SCADA_CONNECTOR_INSTALL_DIR', $InstallPath,[System.EnvironmentVariableTarget]::Machine)
Expand Down
1 change: 0 additions & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
</ul>
<hr/>
</div>

<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">

Expand Down
13 changes: 7 additions & 6 deletions docs/configuration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,31 @@
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href=".." class="icon icon-home" alt="Docs"></a> &raquo;</li><li>Configuration</li>
<li><a href=".." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li>Configuration</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>

<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">

<h1 id="connector-configuration">Connector Configuration<a class="headerlink" href="#connector-configuration" title="Permanent link"></a></h1>
<p>The configuration files are in <strong><InstallRoot>/volume/config</strong> directory. </p>
<p>The configuration files are in <strong>&lt;InstallRoot&gt;/volume/config</strong> directory. </p>
<p>The following configuration files need to be created to configure the connector:</p>
<ul>
<li><code>connection.json</code>: Contains connection related configuration items to connect to MAS and SCADA historian.</li>
<li><code>connection.json</code>: Contains the connection related items to connect to MAS Monitor and SCADA historian.</li>
<li><code>mapping.json</code>: Contains mapping configuration to map columns from mapping.csv file into device type, device id, dimensions and metrics, and transform data extracted data from SCADA historian and send to MAS.</li>
<li><code>CSV file</code>: CSV file with the Tag Points data that is used by the <code>mapping.json</code> to map the assets and the data into MAS Monitor.</li>
</ul>
<h2 id="pre-requisite">Pre-requisite<a class="headerlink" href="#pre-requisite" title="Permanent link"></a></h2>
<ul>
<li>To create <code>connection.json</code> file, you need SCADA Historian and MAS connectivity URL and credentials. For details refer to corresponding sections.</li>
<li>A CSV file with TAG Point data, typically exported from PI Builder, is needed to create mapping rules configuration file.</li>
<li>The <code>CSV file</code> can be created using PI Builder or created manually following the expected format.</li>
</ul>
<h2 id="configuration-details">Configuration details:<a class="headerlink" href="#configuration-details" title="Permanent link"></a></h2>
<p>For details on connection and mapping rules configuration items, refer to the following sections:</p>
<p>For details on the format and content of each configuration file, refer to the following sections:</p>
<ul>
<li><a href="../connection/">Connection Configuration</a></li>
<li><a href="../mapping/">Mapping Rules Configuration</a></li>
Expand Down
98 changes: 61 additions & 37 deletions docs/connection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Connection Configuration</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#configuration-object">Configuration Object</a>
<li class="toctree-l2"><a class="reference internal" href="#connection-configuration-object">Connection Configuration Object</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#sample-connectionjson-configuration-file">Sample connection.json Configuration File</a>
</li>
Expand All @@ -83,21 +83,19 @@
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href=".." class="icon icon-home" alt="Docs"></a> &raquo;</li><li>Connection Configuration</li>
<li><a href=".." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li>Connection Configuration</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>

<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">

<h1 id="connection-configuration">Connection Configuration<a class="headerlink" href="#connection-configuration" title="Permanent link"></a></h1>
<p>The <code>connection.json</code> is a JSON file that allows you to define the connection related
configuration item to connect to SCADA historian database and MAS. The location of this
file is <code>&lt;InstallRoot&gt;/ibm/masshc/volume/config/connection.json</code>. </p>
<h2 id="configuration-object">Configuration Object<a class="headerlink" href="#configuration-object" title="Permanent link"></a></h2>
<p>The <code>connection.json</code> is a JSON file that allows you to define the Connector connection-related items to connect to SCADA historian database and MAS. The location of this file is <code>&lt;InstallRoot&gt;/ibm/masshc/volume/config/connection.json</code>. </p>
<h2 id="connection-configuration-object">Connection Configuration Object<a class="headerlink" href="#connection-configuration-object" title="Permanent link"></a></h2>
<p>Provide connection configuration object in a json formated file:</p>
<pre><code>{
&quot;id&quot;: &quot;String&quot;,
Expand All @@ -111,7 +109,8 @@ <h2 id="configuration-object">Configuration Object<a class="headerlink" href="#c
&quot;dbType&quot;: &quot;String&quot;,
&quot;schema&quot;: &quot;String&quot;,
&quot;database&quot;: &quot;String&quot;,
&quot;extractInterval&quot;: integer
&quot;extractInterval&quot;: Integer,
&quot;extractIntervalHistorical&quot;: Integer
},
&quot;iotp&quot;: {
&quot;url&quot;: &quot;String&quot;,
Expand All @@ -125,45 +124,60 @@ <h2 id="configuration-object">Configuration Object<a class="headerlink" href="#c
&quot;asHost&quot;: &quot;String&quot;,
&quot;asKey&quot;: &quot;String&quot;,
&quot;asToken&quot;: &quot;String&quot;,
&quot;asAPIVersion&quot;: integer
}
&quot;apiVersion&quot;: Integer,
&quot;publishProtocol&quot;: &quot;String&quot;,
&quot;trustServerCert&quot;: Integer,
&quot;mamUserEmail&quot;: &quot;String&quot;,
&quot;publishProtocol&quot;: Integer,
&quot;iotClientType&quot;: Integer
},
&quot;isSAASEnv&quot;: Integer,
}
</code></pre>
<p>Where:</p>
<ul>
<li><code>id</code>: Description to identify the connection json file</li>
<li><code>id</code>: Description to identify the connection json file. It's also the name of the cache file being created in <code>&lt;InstallRoot&gt;/ibm/masshc/volume/data/tagcache</code> by the connector.</li>
<li><code>historian</code>: This configuration object is required. The configuration items specified in this object are used
to connect to SCADA historian to extract device data and send to MAS Monitor.
<strong> Required Items: </strong><ul>
<li><code>type</code>: Historian type. The valid options are "osipi" or "ignition".</li>
<li><code>jdbcUrl</code>: JDBC URL to connect to the historian database. Example "jdbc:pisql://10.208.72.125/Data Source=pidemo; Integrated Security=SSPI;"</li>
<li><code>jdbcUrl</code>: JDBC URL to connect to the historian database. Example <em>"jdbc:pisql://10.208.72.125/Data Source=pidemo; Integrated Security=SSPI;"</em>.</li>
<li><code>user</code>: User name to connect to historian.</li>
<li><code>password</code>: Password to connect to historian.</li>
<li><code>serverTimezone</code>: Timezone of historian database server. Example "American/Chicago"</li>
<li><code>startDate</code>: Extract device data from the specified date. Valid format is "YYYY-MM-DD HH:MM:SS"
<strong> Optional Items: </strong></li>
<li><code>dbType</code>: Database server configured as SCADA hostorian. The default value is "pisql" (OSIPI historian)</li>
<li><code>schema</code>: Schema name. The default value is "piarchive"</li>
<li><code>database</code>: Database name. The default value is "picomp2"</li>
<li><code>extractInterval</code>: Data from historian is extracted in chunk. The <code>extractInterval</code> specifies the time window in seconds for the chunk. The default value is 60 seconds. The valid range is 30 to 900 seconds.</li>
<li><code>serverTimezone</code>: Timezone of historian database server. It needs to be a Time zone ID (Example <em>"American/Chicago"</em> or <em>"PST"</em>). Refer to <br> <a href="https://www.ibm.com/docs/en/was/9.0.5?topic=ctzs-time-zone-ids-that-can-be-specified-usertimezone-property">this document</a> for valid inputs.</li>
<li><code>startDate</code>: Extract device data from the specified date. Valid format is <em>"YYYY-MM-DD HH:MM:SS"</em></li>
<li><code>dbType</code>: Type of database server configured as SCADA hostorian. If not specified, database type is taken as MYSQL. Feasible values are <em>"pisql"</em> (OSIPI historian) or <em>mssql</em> (which defaults to MYSQL). </li>
<li><code>schema</code>: Schema name. It is used to create the SQL query. <code>From &lt;schema&gt;.&lt;database&gt; where time ...</code>. Example for OSI PI: <em>"piarchive"</em>.</li>
<li><code>database</code>: Database name. It is also used to create the SQL query. <code>From &lt;schema&gt;.&lt;database&gt; where time ...</code>. Example for OSI PI: <em>"picomp2"</em>.</li>
<li><code>extractInterval</code>: Specifies the timewindow (in seconds) of each SQL query. The maximum and default value is <em>120</em>.</li>
<li><code>extractIntervalHistorical</code>: Specifies the timewindow (in seconds) of each SQL query when historical data (past data) is requested. The default value is <em>1800</em>.</li>
</ul>
</li>
<li><code>iotp</code>: This configuration object is required. The configuration items are used to configure MAS and send device data to MAS. To configure <code>iotp</code> object, you need credentials from MAS Monitor. You can get these information using MAS Monitor dashboard.
<strong> Required Items: </strong><ul>
<li><code>url</code>: Specifies base URL to invoke APIs to configure MAS</li>
<li><code>orgId</code>: Specifies a six character organization Id assigned to your IoT Platform service.</li>
<li><code>host</code>: Specifies host to connect to MAS to send device data</li>
<li><code>port</code>: Specifies port to connect to MAS </li>
<li><code>apiKey</code>: Specifies API Key to configure device types, devices, interfaces and send MQTT messages.</li>
<li><code>apiToken</code>: Specifies API Token to configure device types, devices, interfaces and send MQTT messages.</li>
<li><code>schemaName</code>: Specifies the schema to configure dimensions</li>
<li><code>tenantid</code>: Specifies tenant id.</li>
<li><code>asHost</code>: Specifies host to configure dimensions</li>
<li><code>asAPIVersion</code>: Specifies API Version. Valid options are 1 and 2.</li>
<li><code>asKey</code>: Specifies API Key to configure dimensions</li>
<li><code>asToken</code>: Specifies API Token to configure dimensions</li>
<li>
<p><code>iotp</code>: This configuration object is required and contains the essential information to configure the connector for connecting to MAS and send device data to it. To fill in this object, you need credentials from MAS Monitor API and IoT tool API.
<strong> Required Items: </strong></p>
<ul>
<li><code>url</code>: Specifies MAS Monitor IoT tool API URL used to configure MAS.</li>
<li><code>orgId</code>: Specifies a six character organization Id assigned to your IoT Platform service. It is usually the first element in the <code>url</code> item.</li>
<li><code>host</code>: Specifies IoT tool host for connecting to MAS to send device data.</li>
<li><code>port</code>: Specifies port to connect to MAS.</li>
<li><code>apiKey</code>: Specifies IoT tool API Key to configure device types, devices, interfaces and send MQTT messages.</li>
<li><code>apiToken</code>: Specifies IoT tool API Token to configure device types, devices, interfaces and send MQTT messages.</li>
<li><code>schemaName</code>: Specifies the database schema to configure dimensions.</li>
<li><code>tenantId</code>: Specifies tenant ID.</li>
<li><code>asHost</code>: Specifies MAS Monitor host to configure dimensions.</li>
<li><code>asKey</code>: Specifies MAS Monitor API key to configure dimensions.</li>
<li><code>asToken</code>: Specifies MAS Monitor API token to configure dimensions.</li>
<li><code>apiVersion</code>: Specifies Monitor API version. Valid options are <em>1</em> and <em>2</em> (default).</li>
<li><code>trustServerCert</code>: Specifies whether to trust all SSL certificates or not. If set to <em>1</em>, all certificates are trusted.</li>
<li><code>mamUserEmail</code>: Email address used to create the REST client if <code>apiVersion</code> is set to <em>2</em> and <code>isSAASEnv</code> is set to <em>0</em>.</li>
<li><code>publishProtocol</code>: Specifies the protocol/method used to publish. Default value is <em>"mqtt"</em>. Other valid values are <em>"kafka"</em> and <em>"dbupload"</em> but they are not currently supported.</li>
<li><code>iotClientType</code>: Defines the IoT MQTT client type. Default value is <em>1</em> (Device Client), but it can also take <em>2</em> (Gateway client) or <em>3</em> (Application client). It affects the publisher.</li>
</ul>
</li>
<li>
<p><code>isSAASEnv</code>: Decides the initialization of te REST client. If set to <em>0</em>, REST client uses the Monitor API credentials, while for any other value it will use the IoT tool credentials.</p>
</li>
</ul>
<h2 id="sample-connectionjson-configuration-file">Sample <code>connection.json</code> Configuration File<a class="headerlink" href="#sample-connectionjson-configuration-file" title="Permanent link"></a></h2>
<pre><code>{
Expand All @@ -174,7 +188,12 @@ <h2 id="sample-connectionjson-configuration-file">Sample <code>connection.json</
&quot;user&quot;: &quot;Administrator&quot;,
&quot;password&quot;: &quot;xxxxxxxxxx&quot;,
&quot;serverTimezone&quot;: &quot;American/Chicago&quot;,
&quot;startDate&quot;: &quot;2021-12-05 05:00:00&quot;
&quot;startDate&quot;: &quot;2021-12-05 05:00:00&quot;,
&quot;dbType&quot;: &quot;pisql&quot;,
&quot;schema&quot;: &quot;piarchive&quot;,
&quot;database&quot;: &quot;picomp2&quot;,
&quot;extractInterval&quot;: 120,
&quot;extractIntervalHistorical&quot;: 1800
},
&quot;iotp&quot;: {
&quot;url&quot;: &quot;https://tenant1.iot.monitordemo.ibmmam.com/api/v0002&quot;,
Expand All @@ -186,10 +205,15 @@ <h2 id="sample-connectionjson-configuration-file">Sample <code>connection.json</
&quot;apiToken&quot;: &quot;cNyH_XXXXXX-p2ppVl&quot;,
&quot;tenantId&quot;: &quot;tenant1&quot;,
&quot;asHost&quot;: &quot;tenant1.api.monitor.monitordemo3.ibmmam.com&quot;,
&quot;asAPIVersion&quot;: 1,
&quot;asKey&quot;: &quot;xxxxxxxxxxxxxxxxxx&quot;,
&quot;asToken&quot;: &quot;xxxxxxxxxxxxxxxxxxxx&quot;
}
&quot;asToken&quot;: &quot;xxxxxxxxxxxxxxxxxxxx&quot;,
&quot;apiVersion&quot;: 2,
&quot;trustServerCert&quot;: 1,
&quot;mamUserEmail&quot;: &quot;[email protected]&quot;,
&quot;publishProtocol&quot;: &quot;mqtt&quot;,
&quot;iotClientType&quot;: 1
},
&quot;isSAASEnv&quot;: 0
}
</code></pre>

Expand Down
30 changes: 15 additions & 15 deletions docs/css/theme_extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
* https://github.com/mkdocs/mkdocs/issues/233
*/
.rst-content pre code {
white-space: pre;
word-wrap: normal;
display: block;
padding: 12px;
font-size: 12px;
white-space: pre;
word-wrap: normal;
display: block;
padding: 12px;
font-size: 12px;
}

/**
Expand Down Expand Up @@ -77,9 +77,9 @@ pre .cs, pre .c {
* https://github.com/mkdocs/mkdocs/issues/319
*/
.rst-content .no-highlight {
display: block;
padding: 0.5em;
color: #333;
display: block;
padding: 0.5em;
color: #333;
}


Expand Down Expand Up @@ -113,11 +113,11 @@ form .search-query {
* https://github.com/mkdocs/mkdocs/issues/656
*/
.rst-content .admonition code {
color: #404040;
border: 1px solid #c7c9cb;
border: 1px solid rgba(0, 0, 0, 0.2);
background: #f8fbfd;
background: rgba(255, 255, 255, 0.7);
color: #404040;
border: 1px solid #c7c9cb;
border: 1px solid rgba(0, 0, 0, 0.2);
background: #f8fbfd;
background: rgba(255, 255, 255, 0.7);
}

/*
Expand All @@ -135,8 +135,8 @@ form .search-query {
}

td, th {
border: 1px solid #e1e4e5 !important; /* csslint allow: important */
border-collapse: collapse;
border: 1px solid #e1e4e5 !important; /* csslint allow: important */
border-collapse: collapse;
}

/*
Expand Down
Loading

0 comments on commit 785a9b7

Please sign in to comment.