Step 1. Log in to the OL Hub from the CLI
Have at your disposal your API key. You can generate one on the OL Hub.
temp> ol login --api-key MjhjMDlhMQ5ZA==temp$ ol login --api-key MjhjMDlhMQ5ZA==Step 2. Check what data sources you can connect to
- To display the data source connectors list run the following command:
temp> ol list connectorstemp$ ol list connectors
The connector list is displayed:
connector name connector version ================================================================================ IBMi-as400-cobol 1.14.0 IBMi-as400-pcml 1.14.0 cics-cobol 1.14.0 ims-cobol 1.14.0 mf-ctg-cobol 1.14.0 oracle-stored-procedure 1.14.0 sap 1.14.0 - Write down the name of the connector you're looking for. You will need it for the next step.
Step 3. Comply with the connector prerequisites
Make sure that all connector prerequisites are fulfilled.
Go to your selected connector cheat sheet to check for prerequisites.
Step 4. Create the module for your connector
Provide the connector and the module name to the ol create module command.
temp> ol create module —connector [connector-name] —name [module-name]temp$ ol create module —connector [connector-name] —name [module-name]
The module folder containing the module configuration file (module.json) is created.
Step 5. Test the data source connection details
- Learn what the data source connection details are. To do so, run the ol add command or the ol test connection command with the global --help option.
[module-name]> ol test connection --help[module-name]$ ol test connection --help
The data source connection properties are displayed. - Run the ol test connection command to verify that the data source is accessible and that the connection properties are correct.
Go to your selected connector cheat sheet and copy the ol test connection command.
The success status of the connection test is displayed.
Step 6: Add an asset to your module
The next few steps have to be executed from the module folder directory.
-
Go to the module folder:
temp> cd [module-name]temp$ cd [module-name] -
Add an asset to your local file.
Go to your selected connector cheat sheet and copy the ol add command.
The asset folder is created in the module folder. The folder contains the asset configuration file ([asset-name].json) and asset testing resources.
Step 7. Test the asset
Test the asset you added to verify that you can request and receive actual business data from the data source.
-
From your module folder root go to assets/[asset-name]/test_data/case1/.
[module-name]> cd assets/[asset-name]/test_data/case1/[module-name]$ cd assets/[asset-name]/test_data/case1/ -
To specify the test input data open in.json:
case-1> notepad in.jsoncase-1$ notepad in.jsonin.json contains the information sent to the remote business operation. It consists of the input keys and values that the business operation requires. This is a random example of an in.json file:
{ "dfhcommarea" : { "custId" : "", "creditCards" : [ { "cardNumber" : "", "cardType" : "", "cardLimit" : 0, "cardUsage" : 0 }, { "cardNumber" : "", "cardType" : "", "cardLimit" : 0, "cardUsage" : 0 }, { "cardNumber" : "", "cardType" : "", "cardLimit" : 0, "cardUsage" : 0 }] } } -
In in.json, type the values of the input properties. For example, in the example above you would type the value 412-83254 for the custId key and then save the file.
-
Now you are ready to run ol test asset.
[module-name]> ol test asset --asset [asset-name][module-name]$ ol test asset --asset [asset-name]
The test results are displayed. Make sure that the business fields are populated with values.{ "dfhcommarea" : { "custId" : "412-83254", "creditCards" : [ { "cardNumber" : "4580123412341234", "cardType" : "GOLD", "cardLimit" : 5000, "cardUsage" : 1783 }, { "cardNumber" : "4580002377826452", "cardType" : "PLATINUM", "cardLimit" : 10000, "cardUsage" : 567 }, { "cardNumber" : "4580887386255265", "cardType" : "BUSINESS-G", "cardLimit" : 7000, "cardUsage" : 4873 }, { "cardNumber" : "4580108372533424", "cardType" : "BASIC", "cardLimit" : 1000, "cardUsage" : 0 }, { "cardNumber" : "4580773685986244", "cardType" : "FT-MEMBER", "cardLimit" : 2000, "cardUsage" : 600 } ] } }
Step 8. Push the asset to the OL Hub
After you have successfully tested the module and its assets, you can upload it to the OL Hub.
[module_name]> ol push module[module_name]$ ol push module
