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

  1. Open the Query-Report Builder, find your custom report, and then click on the API Assignment button.
  2. 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.
    Report builder 02
  3. 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.
    Report Builder 03
  4. 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.
    Query Entities and Attributes 01
  5. Double-click on the attribute you'd like to assign to a parameter name and click on the Invoke... option.
    Query Entities and Attributes 02
  6. Select the create_api_parameter_mapping API function.
    Query Entities and Attributes 03
  7. Fill in the functionName and parameterName in the API Call Form and click on the Invoke now button.
    API Call form - Query Entities and Attributes 03
  8. 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.
    Report builder 04
  9. Click on the greater-than arrow '>' and click the Apply button
    Report builder 05
  10. 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.
    Detailed Session List 03
  11. Click on the API function (in our case create_user_hierarchy).
    Detailed Session List 04
  12. Notice that the userName is now populated from the report field.
    API call form - create user hierarchy 02
  13. Fill in the parentUserName and click the Invoke now button.
    API call form - create user hierarchy 03
  14. Verify that the new Data Security User Hierarchy has been added.
    Data Security User Hierarchy 05