Reusing Connections
Overview
Modules represent functions in the backend (e.g. Customers, Accounts, Users). When those functions reside on the same backend, Modules use the same connection details.
Instead of cloning the connection details by value for every different Module, Connection objects can be created that are referenced by every module in the same backend. Note that modifying the Connection profile will apply to all the modules using this Connection profile.
Connection Profile
- A Connection object can contain multiple Profiles (Default + Profiles).
- A user can Create/Edit/Delete a Connection and its Profiles.
- Connection Name
- Connection Description
- Connection Attachments
- Referring Modules
- For a Connection created with a Default Profile, the user may:
- Add a Profile
- Edit the Profile
- Delete the Profile (except from the Default)
Create a Connection
-
Select Connections from the menu.
-
Press + Create Connection.
-
The Create New Connection window opens.
-
Type a Connection Name and select a Backend Type from the list. Press the Create Connection button to create the connection with a default profile.
-
The new connection appears on the Connections page.
-
To add or edit a Connection Profile, click on the Connection icon:
-
The default Connection Profile is displayed:
-
To edit the default profile, press the edit icon
.
-
To add a profile, press + Add profile. Enter a Profile name and edit the Connection Profile Details. Then press the Create button.
-
The new Connection Profile is displayed.
- You may enter a description for the new profile by pressing the Description
icon.
- To delete the profile, press the
icon.
- To test the profile, press the test
icon.
- Note that the new profile inherits fields that are not modified from the default profile.
- You may enter a description for the new profile by pressing the Description
-
Note that if you try to edit an existing profile, you will be prompted to confirm.
Connections List
The Connections page displays the list of connections with the following properties:
- Connection name
- Connection description
- Backend Type
- Last update
- Last updater
- Profiles list
- Referring Modules list
Using Connections
With New Module
-
On the Modules page, press + Create Module.
-
The Select Connector page is displayed.
-
Use the Filter to select the backend type.
-
Select one of the connector backend types by clicking on it.
-
Press the Create Module from the Connector button. Type the new Module Name. To use an existing Connection, choose Select Connection and select from the list of available connections..
-
Press the Done button to save the new module.
-
The new module appears on the Modules page.
With Existing Module
-
On the Modules page, click on the Module to select.
-
Click on the
icon adjacent to the module name and select Change connection from the dropdown menu.
-
On the Change Connection references page, select a connection from the existing connections and press Replace.
-
A confirmation window opens. Press the Apply button to replace the connection.
-
The module is displayed with the selected connection indicated by the
icon next to the connection name.
Using Connections in the CLI
Commands
ol list connections
Usage: ol list connections [OPTIONS]
Display OL-HUB connections list
Options:
--verbose Enables verbose mode
--verbose-debug Enables debug mode
--verbose-trace Enables trace mode
-l, --limit INT The total number of connections to return in the
command's output
-o, --offset INT An offset to specify where to start paginating
-f, --filter TEXT RegEx filter by connections names
-h, --help Show this message and exit
Example
The command output includes the connection Id, Name, Connector Type and Description.
C:\WINDOWS\system32>ol list connections
DONE
Id Name Connector Type Description
============================================================================================================================================================================================================================
a1ec7302-d17f-4ec2-a0da-8b0a05e0a117 demo-account-default-connection oracle_db Auto-generated connection for module demo-account
8ced1e55-fbce-4773-bfae-087ed9e19a36 m-as400-screens-default-connection as400Screens Auto-generated connection for module m-as400-screens
30b4d357-0407-464a-a586-e1437890032c as400-screens-default-connection as400Screens Auto-generated connection for module as400-screens
0129e054-0712-48c3-885a-ce1f073d7404 as400 as400Rpc as400
b23c9289-2057-4d0c-90af-9f3f904aad41 as400-pcml as400Rpc
ol create module MODULE_NAME --connector
Example:
ol create module as400-cobol --connector as400-cobol
The new module is created with the default connector type and default profile.
Linking Connections between the CLI and the OL Hub
The Connection is an OL Hub object. It does not exist in the CLI until the Module is pushed to the Hub.
Therefore, if you create a Module in the CLI, it behaves as follows:
- Running the ol test connection command in the CLI will store the connection details in the profile (no Hub connection yet).
- When you push the module to the Hub, it will create a new Connection for the profile/s or use the Hub Module Connection if it already exists.
- If you link an existing Connection to the Module, then the Module Connection and its profiles are copied to the module.json. When you push the Module to the Hub, it will use the Module Connection that you've linked.
Updated 4 months ago