Creating a RESTful DSA data source

Use this information to create a RESTful DSA data source.

Procedure

  1. Select the Data Model tab.
  2. From the Cluster and Project lists, select the cluster and project you want to use.
  3. To create a new RESTful data source, click New Data Source > RESTful API.
  4. In the Data Source Name field:

    Enter a unique name to identify the data source. You can use only letters, numbers, and the underscore character in the data source name. If you use UTF-8 characters, make sure that the locale on the Impact Server where the data source is saved is set to the UTF-8 character encoding.

  5. Set the Host Name. The host name can be a fully qualified domain name or IP address. Do not include the protocol or port number. For example: ibm.com, api.ibm.com, 192.168.1.255.
  6. Set the Resource Path. The resource path will be appended to all REST requests for this data source. For example: /v1/api, /api/stats/, /services/data.
    Tip: You can extend the resource path using the Path parameter in the RESTful policy function instead. The RESTful function combine the Resource Path from the data source and the Path parameter to create the complete path for its REST request.
  7. Set the Port number. For the SSL protocol, the default port is 443.
  8. To enable an SSL connection between the DSA and the endpoint, select the Use HTTPS check box.
    • For SSL connections, you must add the endpoint SSL certificate(s) to Impact's trust store. See Enabling SSL connections with external servers for more information on how to add SSL certificates to the trust store.

    • version 7.1.0.20+ You can skip the trust store requirement by selecting the Disable SSL Verification check box instead.

  9. Select the Reuse Connection check box if required.

    Connection caching is done at a policy level. This means the same HTTP connection can be reused within a policy when it is running.

  10. Select the Cache Response check box if required.

    Note: Response caching is based on entity tags. It is one of several mechanisms that the HTTP protocol provides for cache validation, which allows a client to make conditional requests. Impact by default adds a Cache Control : Max-Age=0 header that causes any caches used during the request to re-validate ensuring that the entity tag is checked. Modify this header to the Cache Control setting you want to use. Impact by default adds a Cache Control : Max-Age=0 header to any newly created REST data sources in the HTTP header list.

  11. Authentication.

    If using basic authentication, you must provide the username and password:

    1. In the User Name field type a user name with which you can access the REST API.
    2. In the Password field type a password with which you can access the REST API.

    If using OAuth authentication, you must provide the OAUTH Data Source. (To configure an OAUTH Data Source, see Creating an OAuth data source.):

    1. Select the Use OAuth check-box to enable OAUTH authentication.
    2. Select the OAuth data source that you want to use from the drop-down menu.
  12. Specify an HTTP header if you are making requests to a datasource where the same HTTP header are being used consistently.
    For example, if a new header is added to the grid, this is the same as adding a request header. If the grid has the following header details:
    Header Name            Header Value
    Content-Type           application/json
    Max-Forwards           10

    The following will be added to the URL when making the request:

    GET /api/alerts/v1 HTTP/1.1
    Host: ibmnotifybm.mybluemix.net
    Authorization: Basic ******************
    Content-Type: application/json;charset=UTF-8
    Max-Forwards: 10
  13. version 7.1.0.31+ Set the Protected Request Headers. If the value of a request header contains sensitive information such as an API key or authorization token, you can use Protected Request Headers to hide the value from the user interface and policy logger.
    Note: If the same request header is also declared in a policy or as a normal Request Header, then the DSA uses the following order of precedence when selecting a header value: Policy > Normal Request Headers > Protected Request Headers.
  14. Specify HTTP parameters if you are making requests to the datasource where the same HTTP parameters are being used consistently.

    The REST API datasource can persist these and they will be used on every call to the data source unless overridden by the policy function.

    For example, if a new parameter is added to the grid, this is the same as adding a query parameter to the request. If the grid has the following paramaters:
    Parameter Name         Parameter Value
    size                   100
    name                   impact

    Then ?size=100&name=impact will be added to the URL when making the request.

  15. Click Test Connection to see if it is possible to connect to the data source with the current data source settings.
    Note: The connection test will send a HTTP GET request to the REST service. You can click Preview Request to review the connection test request.
  16. Click Save to create the data source.