In an offline or air-gapped environment, the IBM Usage
Metering Service cannot connect directly to
IBM Software
Central.
Before you begin
You must have the following prerequisites:
-
IBM Entitlement
Key for authentication
-
Network access to Software Central from the machine performing the upload
-
A kubectl access to the cluster
To use this documentation offline, see Offline and mobile
access.
About this task
You must manually download the usage data and upload it to Software Central.
Procedure
-
Expose the usage metering service.
It depends on your cluster environment but the
service to expose is ibm-usage-metering-instance. The URL exposed by the
service references the next steps as UMS_URL.
- Download usage data.
Retrieve the metering data from the
service:
UMS_TOKEN=$(kubectl get secret ibm-usage-metering-upload-token -n "${NAMESPACE}" -o jsonpath='{.data.token}' 2>/dev/null | base64 -d || echo "")
UMS_URL=<URL FOR THE USAGE METERING SERVICE>
curl -k --output "swc_payload.tar.gz" \
--header "Authorization: Bearer ${UMS_TOKEN}" \
- Verify the downloaded data.
Extract and inspect the usage
data:
tar xvzf swc_payload.tar.gz
Expected output:
x manifest.json
x usage.json
Extracted output:
manifest.json: Metadata about the usage data package
usage.json: Actual usage metrics data
- Product usage statistics (for example, number of pods and resources)
- Metric collection timestamps and intervals
- Upload data to Software Central.
Upload the usage data to
Software Central:
curl -X POST "https://swc.saas.ibm.com/metering/api/v2/metrics" \
-H "Authorization: Bearer <IEK>" \
-F "file=@swc_payload.tar.gz;type=application/gzip"
Parameter:
- Verify upload.
Verify the usage data in the
Software Central portal:
- Go to MyIBM Container Software Library
.
- Check the usage reports section for your uploaded data.
Tip: Schedule this process regularly (for example, monthly) to ensure compliance
reporting is up to date.