# Creating HTTP Data Sets

Use data sets to collect the information that you will use to build charts, tables, and dynamic inputs.

## Before You Begin

- To use remote CommServe computers as data sources for REST APIs, you must configure authentication using SAML. For more information, see External Authentication with SAML Integration (SSO) - {{ webconsole }}.

- To create an embedded data set, your CommCell user account requires a role with the following permissions and associations:

  - Add Report permission and an association with the CommCell entity

  - Query Datasource permission and an association with the Data Source entity that you will use

  For more information on users, permissions, and associations, see User Administration and Security - Overview.

## Procedure

1. Create a new report, or open an existing report:

   1. To create a new report, from the navigation pane, go to Manage > Integration> Reports, and then click New Report.

   2. To open an existing report and add a new data set to it, from the navigation pane, go to Manage > Integration > Reports, and next to the Report Name under Actions, click Edit.

2. On the Report Builder page, in the Report Name box, type a name for the report, and in the Description box, type a short description of the report.

3. On the Data Sets tab, click Add.

   The Add Data Set dialog box appears.

4. At the top of the dialog box, from the list, select HTTP, and in the Data Set Name box, type a name.

5. In the Data Sources list, select the name of a data source:

   1. To use Commvault REST APIs, select CommCells.

   2. To use third-party REST APIs, select Other HTTP.

6. To use secured HTTP, select Use HTTPS.

7. Next to HTTP Method, select the type of REST API you want to use to collect or send data:

   1. If you select GET, you must complete the following steps:

      1. In the REST API box, enter the path for the REST API that you want to use.

         For example: /SearchSvc/CVWebService.svc/Job

         Commvault REST API data sets can be used only on CommServe computers. For a list of REST APIs, see REST API - API Library.

         Authorization tokens will be automatically entered in the headers for the local CommCell environment's Web Server.

      2. For third-party REST APIs, in the REST URL box, enter the address for the REST API that you want to use.

         For example: https://api.github.com/repos/jquery/jquery/issues

      3. To add URL parameters, click Add.

      4. In the Key box, type a name, and then in the Value box, type the value that you created on the Parameter tab.

   2. If you select POST, you must complete the following steps:

      1. In the REST API box, enter the path for the REST API that you want to use.

         For example: /SearchSvc/CVWebService.svc/Job

         Commvault REST API data sets can be used only on CommServe computers. For a list of REST APIs, see REST API - API Library.

         Authorization tokens will be automatically entered in the headers for the local CommCell environment's Web Server.

      2. For third-party REST APIs, in the REST URL box, enter the address for the REST API that you want to use.

         For example: https://api.github.com/repos/jquery/jquery/issues

      3. To add URL parameters, click Add.

      4. In the Key box, type a name, and then in the Value box, type the value that you created on the Parameter tab.

      5. In the HTTP Content box, enter the request content that you want to send to the server.

      6. Next to Content type, to specify the language of the content, select XML or JSON.

8. Next to Accept Type, to specify the language you want to receive information in, select XML or JSON.

   If you select XML, on the Fields tab, an XPath expression is displayed for each field, and if you select JSON, a JSONPath expression is displayed for each field.

9. If you are using third-party REST APIs and you want to use headers, next to Headers, click Add, and then specify the Header and Value in the boxes.

10. Click Preview to retrieve all possible row expressions from the response to the REST API or REST URL that you entered.

    If you leave the Row Expression box blank, all available rows appear in the Row Expression box in either XPath or JSONPath.

11. Configure the row expression for Commvault REST APIs or third-party REST APIs:

    1. For Commvault REST APIs, in the Row Expression box, edit the XPath or JSONPath row expression to retrieve the data that you want to use in your data set.

       XPath example: /JobManager_JobListResponse/jobs/jobSummary/subclient

       JSONPath example: $.jobs[*].jobSummary.subclient

    2. For third-party APIs, in the Row Expression box, edit the XPath or JSONPath row expression to retrieve the data that you want to use in your data set.

12. Click Preview to retrieve the fields from the response.

    This image is an example of Commvault REST API using XPath:

13. Optional: Change the display names of the fields that will appear in the Data Sets list. Click the Fields tab, then in each box under Field Name, type a display name for the corresponding Field Source.

14. Optional: Change the field type for each XPath expression. Under Field Type, click any box to select a different value.

    Note: The Parameters tab is used only to associate report inputs with the data set. Leave the settings on this tab. For details, see Inputs for Reports.

15. Optional: Select the amount of time that the query will run before it times out. Click the Advanced tab, and in the Time Out box, type or select the number of minutes.

16. Click Done.

    The data set you created appears in the Report Builder under Data Sets.

## What to Do Next

- If you are creating a report: Building and Deploying Reports.

- If you are creating a dynamic input: Adding Inputs to Reports.

×

Loading...