Parameterizing a custom pipeline configuration file


As an integration developer, after you create a custom pipeline configuration file, you can allow your end users to customize the parameters defined in the custom pipeline configuration file. For example, you might end users to be able to provide the values for URL, refresh interval, user name, and password.

Perform the following tasks to parameterize the custom pipeline configuration file:

  1. Identify the parameters that you would want your end users to customize. 
  2. Based on your finalized parameter list, define them in the pipeline configuration file according to the recommended syntax.
  3. Test the parametrization by using the Custom Integration template UI.
  4. Verify the parameterization process.

Before you begin

To identify parameters for customization

After you create a custom pipeline configuration file, you can allow your end users to provide values to the parameters defined in the custom pipeline configuration file. There are different types of parameters in a pipeline configuration file, and you can choose to parameterize them based on your requirement. 

Example user parameters

The following table lists a few example user parameters that you can parameterize.


To define the parameters in the pipeline configuration files

After you have identified the parameters that you want your users to customize, define them in the BMC recommended format in the pipeline configuration file. The following instructions help you define a parameter in the solarwinds_events_pipeline.conf file. 

  1. Navigate to the /opt/bmc/connectors/<connector-name>/data/<integration ID>/pipeline/ directory.
  2. Open the solarwinds_events_pipeline.conf file with a text editor.
    The following example shows you how to parameterize url, user, and password parameters in the configuration file.

    #Code before parameterizing
    #Initial code developed by the Integration developer
    <source>
      @type bmc_ade_http_pull
      tag refreshEvents
      url https://host.test.com:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT top 5 e.EventID, tolocal(e.EventTime) as LocalEventTime, e.NetObjectID, n.DNS, n.IP, e.EventType, et.Name as EventTypeName, et.Icon, e.Message, tostring(e.Acknowledged) as status, e.InstanceType, e.DisplayName, e.Description FROM Orion.Events e , Orion.EventTypes et, Orion.Nodes n where e.EventType = et.EventType and e.NetObjectID = n.NodeID and e.EventTime > ADDSECOND(-(((CURRENT_TIME/1000)-(LAST_FETCH_TIME/1000))*1),GETUTCDATE())
      Path to remember the state: config_file_path /fluentd/etc/custom/state_config.json
      interval 20s
      verify_ssl false
      format json
      user user1
      password test123
    </source>


    #Code after parameterizing
    #When a user enters url value in the UI, the PARAMETERS.url is replaced as url <Value provided by the user>
    #When a user enters user name in the UI, the PARAMETERS.user is replaced as user <Value provided by the user>
    #When a user enters a password in the UI, the password value is encrypted, and the PARAMETERS.password.secret is replaced as password ******.
    <source>
      @type bmc_ade_http_pull
      tag refreshEvents
      url {{PARAMETERS.url}}:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT top 5 e.EventID, tolocal(e.EventTime) as LocalEventTime, e.NetObjectID, n.DNS, n.IP, e.EventType, et.Name as EventTypeName, et.Icon, e.Message, tostring(e.Acknowledged) as status, e.InstanceType, e.DisplayName, e.Description FROM Orion.Events e , Orion.EventTypes et, Orion.Nodes n where e.EventType = et.EventType and e.NetObjectID = n.NodeID and e.EventTime > ADDSECOND(-(((CURRENT_TIME/1000) CONTEXT_PARAMETER.LAST_FETCH_TIME/1000))*1),GETUTCDATE())
      Path to remember the state: config_file_path /fluentd/etc/custom/state_config.json
      interval 20s
      verify_ssl false
      format json
      user {{PARAMETERS.user}}
      password {{PARAMETERS.password.secret}}
    </source>
  3. Save the file.

To test parameterization by using BMC Helix Developer Tools

  1. Go to BMC Helix Portal, and click Launch on the BMC Helix Developer Tools tile.
  2. Click the Configured Integrations tab.
  3. Click the action menu of the sandbox integration that you used to create the custom pipeline configuration, and select Edit.
    example_nagios.png
  4. Select Events from the Entity Name list, and enter solarwinds_events_pipeline.conf in the Pipeline File text box. 
  5. In the Custom Pipeline Parameters Section section, enter the parameter name, the corresponding value, and optionally, select the Encrypt option to encrypt the parameter.
    In the following example, the password parameter has the Encrypt option enabled.
    parameter_UI.png
  6. Click Update. 

To verify the parameterization process

  1. Go to the /opt/bmc/connectors/<connector-name>/data/<integration ID>/pipeline/ directory.
  2. View the contents of the solarwinds_events_pipeline.conf file by running the following command:

    cat solarwinds_events_pipeline.conf
  3. Confirm the following entries for a successful parameterization: 

    <source>
      @type bmc_ade_http_pull
      tag refreshEvents
      url https://test.solarhost.com:17778/SolarWinds/InformationService/v3/Json/Query?query=SELECT top 5 e.EventID, tolocal(e.EventTime) as LocalEventTime, e.NetObjectID, n.DNS, n.IP, e.EventType, et.Name as EventTypeName, et.Icon, e.Message, tostring(e.Acknowledged) as status, e.InstanceType, e.DisplayName, e.Description FROM Orion.Events e , Orion.EventTypes et, Orion.Nodes n where e.EventType = et.EventType and e.NetObjectID = n.NodeID and e.EventTime > ADDSECOND(-(((CURRENT_TIME/1000)-(LAST_FETCH_TIME/1000))*1),GETUTCDATE())
      Path to remember the state: config_file_path /fluentd/etc/custom/state_config.json
      interval 20s
      verify_ssl false
      format json
      user testUser
      password *******
    </source>

Where to go from here

After you create a new custom pipeline configuration file and customize it, create a deployable package and associate it with the sandbox integration.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*