API calls for retrieving License Service Reporter data

You can use the dedicated API calls to retrieve information about the aggregated license usage data for your multicluster environment.

Available APIs

Obtaining License Service Reporter URL

To obtain the License Service Reporter URL that is required to run the APIs, complete the following steps.

  1. Open the OpenShift console of the cluster where you deployed License Service Reporter.
  2. Go to Networking > Routes.
  3. Set the project to the namespace where you deployed the License Service Reporter.
  4. Find the ibm-license-service-reporter route and copy the URL listed as Location. It is your License Service Reporter URL.

Note: Alternatively, you can use the following command to obtain the License Service Reporter URL:

   `oc get routes -n <enter the namespace of the License Service Reporter> | grep ibm-license-service-reporter | awk '{print $2}'`

Obtaining an API token

To learn how to get the authorization token, see Obtaining and updating an API token.

Retrieving an audit snapshot

API URL

<License Service Reporter URL>/snapshot?token=<token>

API parameters

For more information about the API parameters and how to use them, see License Service Reporter Swagger API schema.

API description

This API call retrieves a snapshot of license usage for your multicluster environment.

This APIs returns the .zip package that contains the collection of audit snapshot packages for each data source. Each audit snapshot is a compressed .zip package that includes a complete set of audit documents that certify your cumulative license usage. By default, this API retrieves the audit snapshot for the last 30 days.

Note: The files contain information about the highest license usage basing on the data from multiple clusters. The highest license usage is expressed in the metricQuantity column. For more information, see the definition of the highest license usage.

To view a list of files that are included in each audit snapshot package, see Content of the audit snapshot.

Integrating with the audit snapshot

To integrate with the audit snapshot, use the names of the columns from the .csv files as the point of reference, not the column order. The names of the columns are fixed. However, the order of the columns might change.

Retrieving license usage of products

API URL

<License Service Reporter URL>/products?token=<token>

API parameters

For more information about the API parameters and how to use them, see License Service Reporter Swagger API schema.

API description

This API call retrieves information about the products that are deployed on the clusters that deliver data to License Service Reporter. The API returns information about the value and date of the license usage peak. By default, the retrieved data includes information about all IBM Cloud Paks and stand-alone containerized products that are deployed in the multicluster environment for the last 30 days.

This API retrieves the following information per product:

Description
name The name of the product.
id The identifier of the product.
metricPeakDate The date and time when the license usage of the product on all clusters was the highest within the requested period.
metricQuantity The highest license usage that is expressed in the number of license units that the product used on a metricPeakDate.
metricName The license metric unit that is used by the product.

Retrieving license usage of bundled products

API URL

<License Service Reporter URL>/bundled_products?token=<token>

API parameters

For more information about the API parameters and how to use them, see License Service Reporter Swagger API schema.

API description

This API call retrieves information about the highest license usage within the requested period of the bundled products that are deployed on clusters as parts of IBM Cloud Paks. By default, this API retrieves the license usage for the last 30 days.

This API retrieves the following information per each bundled product.

Description
productName The name of the detected bundled product.
productId The identifier of the bundled product.
metricName The license metric unit that is used by the bundled product.
metricPeakDate The date and time when the license usage of the bundled product on all clusters was the highest within the requested period.
metricMeasuredQuantity The highest license usage that is expressed in the number of license units that the product used on a metricPeakDate
cloudpakId The identification number of the IBM Cloud Pak® to which the program is bundled.
cloudpakVersion Version of the IBM Cloud Pak® to which the program is bundled.
metricConversion The ratio that shows how the license usage of the bundled product is counted when compared with the license usage of the IBM Cloud Pak®. It shows how the license metrics of a bundled product are recalculated when compared to the IBM Cloud Pak® license metrics.
cloudpakMetricName The license metric unit that is used by the entire IBM Cloud Pak® to which the bundled product contributes.
metricConvertedQuantity The number of license units that the bundled product contributed to the overall license usage of the IBM Cloud Pak®. The value is calculated by comparing metricMeasuredQuantity against metricConversion.

Retrieving information about data sources

API URL

<License Service Reporter URL>/datasources?token=<token>

API parameters

For more information about the API parameters and how to use them, see License Service Reporter Swagger API schema.

API description

This API call retrieves information about the clusters that deliver license usage data to License Service Reporter.

This API retrieves the following information per product.

Description
datasourceId The unique identifier of the cluster.
datasourceName The name of the cluster as it is displayed on the License Service Reporter user interface.
datasourceType The type of the data source.
  • LS - License Service.
  • LMT - License Metric Tool
lastReported The date and time when the license usage data was last delivered from the data source to License Service Reporter.

Retrieving information about License Service Reporter version

API URL

<License Service Reporter URL>/version

API description

This API call retrieves the following information about the License Service Reporter version:

Description
version The version of License Service Reporter that is deployed on a cluster.
buildDate The buildDate identifies the image that was used to deploy License Service Reporter and might be needed for support purposes.
commit The commit ID identifies the image that was used to deploy License Service Reporter and might be needed for support purposes.