The .zip file which can be used when following this tutorial is attached:
Step 1: Populate ADR with the necessary data
You will need a login to the ADR instance if you want to populate the ADR instance with your own tables/data. For purposes of the demo, you can use the test table specified in the script using the API plugin.
Step 2: Create the script
First, you must add the ADRRestApiPlugin.class to your Plugins directory and then pull it into your script using the “Add Plug-in” button in the Var Handler:
Before you upload the plugin, you must specify table name, API call to be used, etc. These will be converted into variables within the Var Finder.
There will be an option to export the output of the API call as a variable. You must do this! The API Plugin simply executes an API call and returns the JSON as an output variable so you must save the output as “jsonResponse” or similar (see above)
Next, you need to create and add an inline script which will process the data returned from the REST API plugin. We’ve included the inline script we used here. The inline script simply pulls the username and password stored in the table and sets the username and password to those returned values. Add the inline script via the “Add Inline Script” button above and configure the input/output variables to take the jsonResponse variable as the input and return the username and password variables as the output:
Finally, assign the username and password variables you extracted to the “username” and “password” variables in the script:
This has all been done within the .zip file linked above.
When you create the script, make sure that the plugin runs before the inline script so that the returned JSON object will have the necessary data and will not be empty! In the example script, we configured both the plugin and the inline script to run “at start of loop” so that should work for your implementation as well.
Step 3: Create the check with specialized settings
you will need to upload the .zip file and then specify any arguments you pass in as user input in “additional arguments”. These are the user inputs in the test check linked above:
-ats_command "/?cmd=ats_retrieve_row_by_column" -ats_url "http://sestsazd01p.apica.local:8992" -column_names "index" -column_values "index01" -table_name "userlist"
If you decide to set these user inputs (e.g. -ats_command as “standalone variables” rather than “user input fields” within the script, and thus hard-code the values, you will not need to pass them via additional options.
If you run into any issues, reference but do not modify the test checks!