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:
<ca_certificate_file_name>is the name of the file that contains the Certificate Authority (CA) certificate.<file_name>is the name of the file to which you want to save the audit snapshot.<Usage Metering Service URL>is the URL of Usage Metering Service.<token>is your authentication token for connecting to Usage Metering Service.
To obtain the CA certificate, perform the following steps.
-
On OpenShift, run the following command to obtain all root CA certificates:
kubectl get cm kube-root-ca.crt -n <product namespace> -o jsonpath="{.data.ca.crt}"Note This command retrieves the Openshift Ingress root CA certificate. For more information, see the Red Hat documentation.
-
On Kubernetes where Ingress is manually configured, provide the CA certificate that was used to sign the TLS certificate of the Ingress controller.
To obtain the URL and token of Usage Metering Service, perform the following steps.
- Log in to the OpenShift console of the cluster where the product for which you want to obtain the snapshot is installed.
- Open the project of the product.
- 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.
- 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'