Adding connectors to your development environment
To add a connector to your deployment of i2 Analyze, you must develop an i2 Connect connector. For more information about developing connectors, see i2 Connect gateway connector development.
Ensure that the DEPLOYMENT_PATTERN variable in the <config_name>/utils/variables.conf file is set to a pattern that includes the i2 Connect gateway.
For example:
DEPLOYMENT_PATTERN="i2c_istore"
Process overview:
- Create a custom connector image
- Update the configuration to reference connectors
- Build connector images and redeploy
Creating a connector image
Create a connector image from one of the image templates. You can deploy connectors using the following templates:
- Spring Boot for Java based connectors.
- For information about developing connectors in Java, see analyze-connect.
- i2 Connect server for Node v18 based connectors developed using the i2 Connect server SDK.
- For information about developing connectors using the SDK, see analyze-connect-node-sdk.
- NodeJS for Node v18 based connectors.
- User managed for connectors that are not managed by the config development environment. The connectors are managed manually outside of the environment.
The connector should be secured and run on port 3443. For more information about securing your system, see Securing i2 Analyze.
Spring Boot based connector image
Copy the
/templates/springboot-connector-imagedirectory (including the sub-directories) to the/connector-imagesdirectory.
Rename thespringboot-connector-imagefolder to a custom connector name. The name of the directory is used to determine which connectors to deploy. Do not use spaces or special characters in the name.
The directory structure is:- connector-images - <connector_name> - target - connector-definition.json - connector-version.json - ...Copy your connector code into the
targetdirectory of the connector directory. For example, copy your.jarfile into the<connector_name>/targetdirectory.Next, configure your connector.
i2 Connect server based connector image
Copy the
/templates/i2connect-server-connector-imagedirectory (including the sub-directories) to the/connector-imagesdirectory.
Rename thei2connect-server-connector-imagefolder to a custom connector name. The name of the directory is used to determine which connectors to deploy. Do not use spaces or special characters in the name.
The directory structure is:- connector-images - <connector_name> - app - connector-definition.json - connector-version.json - ...Copy the i2 Connect server connector distributable ( the
.tar.gzor.tgzfile) into the connector directory.Next, configure your connector.
NodeJS based connector image
Copy the
/templates/node-connector-imagedirectory (including the sub-directories) to the/connector-imagesdirectory.
Rename thenode-connector-imagefolder to a custom connector name. The name of the directory is used to determine which connectors to deploy. Do not use spaces or special characters in the name.
The directory structure is:- connector-images - <connector_name> - app - connector-definition.json - connector-version.json - ...Copy your connector code into the
appdirectory of the connector directory. For example, copy the files into the<connector_name>/appdirectory. By default, the image will start node with the fileapp.js.Next, configure your connector.
User managed connector
Copy the
/templates/user-managed-connectordirectory to the/connector-imagesdirectory.
Rename theuser-managed-connectorfolder to a custom connector name. The name of the directory is used to determine which connectors to deploy. Do not use spaces or special characters in the name.
The directory structure is:- connector-images - <connector_name> - connector-definition.jsonNext, configure your connector.
Configuring a connector
Populate the values in the
<connector_name>/connector-definition.jsonfile with information about your connector.Key Description idAn identifier that is unique for all connectors that will be deployed. nameA name for the connector that is displayed to users in the client. configurationPathThe full path to the configuration endpoint of the connector. By default, it is config.gatewaySchemaThe short name of an optional gateway schema. When no gateway schema is used, do not provide a value. Add the referenced schema and charting scheme to the gateway-schemasdirectory.typeFor i2 Connect server connectors, set to i2connect-server. For any other connectors, thetypekey is not required.userManagedSet to truefor connectors that are managed outside of the environment. For any other connectors, theuserManagedkey is not required.baseUrlUsed only for connectors with userManagedset totrue. ThebaseUrlvalue is the URL address of the connector. For any other connectors, thebaseUrlkey is not required.sendSensitiveHeadersThis setting effectively disables connectors that employ user-specific configuration. For example:
{ "id": "connector1", "name": "Connector 1", "description": "First connector", "configurationPath": "/config", "gatewaySchema": "template", "sendSensitiveHeaders": "false", "type": "i2connect-server" }or
{ "id": "connector2", "name": "Connector 2", "description": "Second connector", "configurationPath": "/config", "gatewaySchema": "template", "sendSensitiveHeaders": "false", "userManaged": true, "baseUrl": "https://example-connector:3443" }Note:
- If your user managed connector is hosted in a Docker container on a different network to your config development environment, connect the Liberty container to the same network as your user managed connector container. For example, run
docker network connect <connector-network-name> liberty1.<config-name>. - If your connector is running on your host machine, use the
host.docker.internalas the host in thebaseUrlvalue. E.g. "http://host.docker.internal:3000"
- If your user managed connector is hosted in a Docker container on a different network to your config development environment, connect the Liberty container to the same network as your user managed connector container. For example, run
Provide the version of the connector in the
<connector_name>/connector-version.jsonfile. For user managed connectors, this file is not required. Theversionvalue specifies the version of the connector.For example:
{ "version": "0.0.1", "tag": "0-0-1" }
For more information about configuring connectors, see Managing connectors.
Adding connectors to a config
In the configuration you want to deploy your connector with, update the
configs/<config_name>/configuration/connector-references.jsonfile and add the directory name for your connector in theconnectorsarray.
For example, to add the connector in/connector-images/example-connectortheconnector-references.jsonfile contains the followingconnectorsarray:{ "connectors": [ { "name": "example-connector" } ], ... }
Defining a gateway schema (Optional)
You can develop the gateway schema and associated charting schemes by following the instructions in Developing schemas in your configuration development environment. After you develop the schemes, complete the following steps to deploy them with your configuration:
- Copy the schema and charting scheme files to the
/gateway-schemasdirectory.
To define the short name of the gateway schema, the prefix of the file name is used. The convention is defined as:<short>-<name>-schema.xmland<short>-<name>-schema-charting-scheme.xml.
For example, files with the nameslaw-enforcement-schema.xmlandlaw-enforcement-charting-schemes.xmlhave the short namelaw-enforcement. Add the short name of your schema to the
configs/<config_name>/configuration/connector-references.jsonfile in thegatewaySchemasarray.
For example, to add a gateway schema with the short namelaw-enforcement, the file contains the followinggatewaySchemasarray:{ ... ], "gatewaySchemas": [ { "shortName": "law-enforcement" } ] }Note: If you are not using any gateway schemas, do not remove the
gatewaySchemaskey from the file.Set the short name of your schema in the
<connector_name>/connector-definition.jsonas the value for thegatewaySchemakey of the connector that will use the gateway schema.
Building the connector images and redeploying
Run the
deploycommand with your config name, to generate the secrets for your connectors, build the connector images, and deploy your environment.deploy -c <config_name>
After you add connectors to your environment, you can configure the rest of the configuration.