How to use API Calls from Custom Reports
Link API functions to reports and map report fields to the API functional parameters.
Value-added: Through a GUI, quickly and easily map API parameters to custom report fields to be used in API function calls.
By default, a newly created custom report does not have any API functions linked to it. Linking API functions to reports is done through Guardium's Query-Report Builder
- Open the Query-Report Builder, find your custom report, and then click on the API Assignment button.
- The API Assignment panel shows all the API functions assigned to the selected report. Notice for our scenario the report selected has no API functions assigned to it.
- To assign an API function to a report, find an API you'd like to link to the report, click the greater than arrow, and then click the apply button. For our scenario we selected create_uer_hierarchy. When selected a pop-up window will appear that shows the report parameter mappings (which report fields will be used when calling the API function). Notice there are no mapped report fields to parameter names.
- At this point, none of the report fields are mapped to the API parameters. Users can go to the Query Entities & Attributes report to create these mappings, otherwise when invoking the API call none of the parameters will have values. add the API parameter mappings. Open the Query Entities & Attributes report and create the mappings. Since our report for this scenario uses the Client/Server entity within the ACCESS RULES VIOLATIONS domain, filter the report by using the customize button; modifying the report to display only the Client/Server entity.
- Double-click on the attribute you'd like to assign to a parameter name and click on the Invoke... option.
- Select the create_api_parameter_mapping API function.
- Fill in the functionName and parameterName in the API Call Form and click on the Invoke now button.
- Now, when we go back to the Report Builder for our report and look at the API Assignment; clicking on the create_user_hierarchy API function displays the API - Report Parameter Mapping with our mapping of userName to the Report field Client/Server.DB User Name.
- Click on the greater-than arrow '>' and click the Apply button
- Now when we invoke the create_user_hierarchy API function through our report the parameter userName will be populated from the report. To see this, go back to the report and double-click on a row and then click on the Invoke... option.
- Click on the API function (in our case create_user_hierarchy).
- Notice that the userName is now populated from the report field.
- Fill in the parentUserName and click the Invoke now button.
- Verify that the new Data Security User Hierarchy has been added.