This documentation supports the 11.3 version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

Testing

This topic provides instructions for testing export APIs.

Browser-based testing

You can test the BMC Discovery Export APIs using a browser. Enter the following URL in a browser, replacing appliance with the resolvable host name or IP address, using the required CsvApi or XmlApi label, and by using the appropriate user name and password for the appliance that you are connecting to. For example, using the CSV API:

http://appliance/ui/api/
   CsvApi?query=SEARCH%20Host&username=apiuser&password=password

A dialog is displayed. Click the Open button to view that data in the application registered for CSV files. Click the Save button to save the data. The default file name is CsvApi.
For example, using the XML API:

http://appliance/ui/api/
   XmlApi?query=SEARCH%20Host&username=apiuser&password=password

The results are displayed in the browser. Use the File > Save menus to save the output as an XML file.

Command-line testing

You can also test the BMC Discovery Export APIs from a UNIX command line using the wget command .
In this section the examples are for the CSV and XML APIs. The queries in all of the examples are appended to the following command line with no intervening spaces. For the CSV API:

$ wget http://appliance/ui/api/CsvApi?

For the XML API:

$ wget http://appliance/ui/api/XmlApi?

An example query to be appended to the command lines is shown as:

query=SEARCH%20Host\&username=apiuser\&password=password

The wget command returns the HTTP status code, for a successful query this is 200 OK. The data returned by the query example in this section is written to a file in the current working directory which for the CSV API is called:

CsvApi?query=SEARCH%20Host\&username=apiuser\&password=password

For the XML API, the file is called

XmlApi?query=SEARCH%20Host\&username=apiuser\&password=password
Was this page helpful? Yes No Submitting... Thank you

Comments