Book a demo

← Documentation

ol test connection

The ol test connection command confirms that the CLI can adequately contact the remote data source by pinging the destination service, receiving a response, and printing the success status.

The command accepts the connection properties of the remote data source. If the connection attempt succeeds, the connection properties and their values are written to module.json under the profiles key.

The module.json file populated with connection properties:

{
  "id" : "50943f0f-6af4-4276-89b8-aba745f63a3b",
  "moduleName" : "as400-new",
  "connectorName" : "as400-cobol",
  "connectorVersion" : "1.35.0",
  "profiles" : {
    "ol_profile" : {
      "host" : "<as400-host>",
      "user" : "<user>",
      "password" : "'{cipher}32aae59a6050eb6995fa2ef4c5ec27a49b0ef0222dceb059ba$
    }
  },
  "type" : "as400Rpc",
  "dtVersion" : "1.35.0"
}

Note: The hosts, user names and passwords in these examples are placeholders. Replace them with your own values. Use HTTPS for the backend URL wherever the backend supports it, and avoid typing real passwords on the command line where they are kept in shell history.

Rules

  • Log in to the OL Hub.
  • Execute the ol test connection command from the module root folder.

Syntax

ol test connection [OPTIONS]

Options

Dynamic connection properties (required)

Connection properties determine the connection parameters to the module's remote data source. Each data source type has different connection properties. For example, an SAP data source has different connection properties than a REST data source.

To learn what are the connection properties for each data source, refer to the ol add command --help option.

Dynamic connection properties (required) screenshot Testing the connection to a remote SAP backend service

temp> ol test connection --host 1.1.1.1 --client 800
temp$ ol test connection --host 1.1.1.1 --client 800

ol test connection screenshot Testing the connection to a remote mainframe backend service

temp> ol test connection --base-url http://<mainframe-host> --port 12345 --uri-map oldist3 --code-page CP037
temp$ ol test connection --base-url http://<mainframe-host> --port 12345 --uri-map oldist3 --code-page CP037

--profile

What is a connection profile

A connection profile groups the module's connection properties under a single name. You can create several profiles for the same module to satisfy particular use cases.

What is a connection profile screenshot Creating a connection profile

[module-name]> ol test connection --profile dev --host <as400-host> --user <user> --password <password> --code-page 37
[module-name]$ ol test connection --profile dev --host <as400-host> --user <user> --password <password> --code-page 37

A Connection profile enables you to conveniently reuse connection property groups in different ol add and ol test connection runs.

ol test connection screenshot Using a connection profile

[module-name]> ol test connection --profile dev
[module-name]$ ol test connection --profile dev

❗️ You can define multiple profiles for the same module. For example, you can define one connection profile under the name "dev" that includes the connection properties for the development environment and another under the name "prod" that works with the production environment.

The default connection profile

A module is created with a default empty connection profile that gets automatically updated with connection properties when ol test connection or ol add are executed.

If you want to create a new profile with different connection properties than the default profile, specify only existing properties with different values or new properties. The new profile spans the overridden properties and the new properties.

When you run ol test connection or ol add with the new profile, the default profile connection properties that are not part of the new profile will be appended to the new and overridden properties.

The default connection profile screenshot Setting the default connection profile

temp> ol test connection --host <as400-host> --user <user> --password <password> --code-page 37
temp$ ol test connection --host <as400-host> --user <user> --password <password> --code-page 37

After the default profile is set, you can use it in a short form of ol test connection or ol add.

ol test connection screenshot Running ol test connection with default profile

[module-name]> ol test connection
[module-name]$ ol test connection

If you want to create a new profile with different connection properties than the default profile, specify only the different properties.

ol test connection screenshot Creating a new profile based on the default profile

[module-name]> ol test connection --password <prod-password> --profile prod
[module-name]$ ol test connection --password <prod-password> --profile prod

Read more

Tell us about yourself

You've been browsing the catalog. Leave your details to keep exploring.

Privacy policy