Obtaining the audit snapshot

Audit snapshot contains detailed reports about product usage. If a product is a solution bundle that consists of bundled products, the audit snapshot provides information about usage of bundled products and how it contributes to the overall usage of the bundle. It also provides information about context metrics that are not defined in the licensing terms, but are included by the product to give you better visibility of the product usage.

Procedure

To obtain the audit snapshot, run the following REST API request.

curl --cacert <ca_certificate_file_name>.crt --output <file_name>.zip --request GET \ 
--url <Usage Metering Service URL>/api/v1/snapshot \ 
--header 'Authorization: Bearer <token>'

Where:

To obtain the CA certificate, perform the following steps.

To obtain the URL and token of Usage Metering Service, perform the following steps.

  1. Log in to the OpenShift console of the cluster where the product for which you want to obtain the snapshot is installed.
  2. Open the project of the product.
  3. To obtain the Usage Metering Service URL, perform the following steps:
    • On OpenShift, go to Networking > Routes, and select the Location from the ibm-usage-metering-fetch route.
    • On Kubernetes, use the Host from the Ingress that you created manually. For more information, see Configuring Kubernetes Ingress.
  4. To obtain the Usage Metering Service token, go to Workloads > Secrets, and select the value of the token key from the ibm-usage-metering-service-upload-token secret.

Query parameters

By default, the audit snapshot contains data from the previous 30 days and includes all collected license metrics. You can change the period for which the audit is generated and limit the number of collected metrics.

The following table lists parameters that you can use while requesting the audit snapshot.

Parameter Required Comment
startDate No The parameter specifies the start date from which you want to generate the audit snapshot. It must have the following format: YYYY-MM-DD.
endDate No The parameter specifies the end date to which you want to generate the audit snapshot. It must have the following format: YYYY-MM-DD.
metrics No Specifies the list of metrics for which you want to generate the audit snapshot.

Example

The following example shows a REST API request with all optional parameters specified.

curl -k --output snapshot.zip --request GET \
--url hhttps://<Usage Metering Service URL>/api/v1/snapshot?startDate=2025-01-01&endDate=2025-01-01&metrics=API_CALL \
--header 'Authorization: Bearer XXXXXX'