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:
- Identify the parameters that you would want your end users to customize.
- Based on your finalized parameter list, define them in the pipeline configuration file according to the recommended syntax.
- Test the parametrization by using the Custom Integration template UI.
- Verify the parameterization process.
Before you begin
- Download and install the BMC Helix Developer Tools connector.
- Create a sandbox environment by using the Custom Integration template.
- Create a custom pipeline configuration file to integrate with a third-party product.
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.
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.
- Navigate to the /opt/bmc/connectors/<connector-name>/data/<integration ID>/pipeline/ directory.
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>- Save the file.
To test parameterization by using BMC Helix Developer Tools
- Go to BMC Helix Portal, and click Launch on the BMC Helix Developer Tools tile.
- Click the Configured Integrations tab.
- Click the action menu of the sandbox integration that you used to create the custom pipeline configuration, and select Edit.
- Select Events from the Entity Name list, and enter solarwinds_events_pipeline.conf in the Pipeline File text box.
- 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. - Click Update.
To verify the parameterization process
- Go to the /opt/bmc/connectors/<connector-name>/data/<integration ID>/pipeline/ directory.
View the contents of the solarwinds_events_pipeline.conf file by running the following command:
cat solarwinds_events_pipeline.confConfirm the following entries for a successful parameterization:
- url https://test.solarhost.com
- user testUser
- password *******
<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.