This documentation supports the 20.02 (12.0) version of BMC Discovery.

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

Discovering content from Web APIs

You can discover content from Web APIs by using data sources. For example, you might want to retrieve a file from a server through its REST API. You might also choose to perform operations on data accessed through the REST API, by using the TPL "restful" functions.
At the time of release of BMC Discovery 20.02 (12.0), the following Web API data sources were provided. Additional Web API data sources may be added in subsequent TKUs:

  • Dell EMC ScaleIO REST API
  • REST API with basic authentication
  • REST API with digest authentication
  • REST API with OAuth2 authentication
  • Control-M Web API

To discover content from Web APIs

The basic method to discover content from Web APIs is:

  1. Add the data source.
  2. Write a pattern that specifies: 
    1. The data source by name.
    2. A query to access the required information.
  3. Upload and activate the pattern.
  4. Scan the endpoint.

Queries

The query can be any one of the discovery restful functions, for example:

To access a REST API endpoint 

This procedure shows how to retrieve information from a REST API by using a REST API with basic authentication data source. The principles for other host data sources are identical, though you need to make minor modifications, for example, modify paths on Windows hosts running an SSH server.

  1. To create a REST API data source, from the main menu, select Manage > Data Sources.
  2. Click Add and select REST API with basic authentication from the menu.
  3. For details on how to add a data source, see Adding data sources.
    The following are example parameters:
    • Name—the name of the data source. For example, "RESTAPI basic DS". This is how patterns refer to and use the data source. 
    • Endpoint—the address (IPv4 or IPv6) of the host, or a resolvable hostname.
    • Description—a free text description that is displayed on the Data Sources page.
    • Username—the user name with which to access the host.
    • Password—the corresponding password.
    You might also need to add any parameters specific to the data source type. In this example, you might choose to modify the timeout, or choose a nonstandard port.
  4. Write a pattern that uses the data source you created and a query:
    1. Specify the data source:

      ds_host := discovery.dataSource("RESTAPI basic DS");
      
    2. Specify the query: 

      \\ returns the result from the API endpoint
      result := discovery.restfulGet(ds_host, "basic_auth", "/api/1/device/1000");
  5. Upload and activate the pattern.

  6. Scan the host.

To view the information discovered

You can see the data source accesses for each discovery run that uses data sources.

  1. From the Discovery Access section in the Host page, click the latest Discovery Access.
  2. From the top row of the Endpoint section, select the Discovery Run.
  3. Select  n Data Source Accesses Related.  
    The Data Source Access List page is displayed. If there is only one, the Data Source Access page is displayed.
  4. Select the Data Source Access you want to view. 

Was this page helpful? Yes No Submitting... Thank you

Comments