Skip to main content

LicensingService.ListLicenseWorkloads

Page through workload usage from one collection frame. Pass expectedSnapshotId from GetLicenseStatus to keep the first page aligned with that report.

LicensingService · Installed Web API. Use the HTTPS origin of your Prokrust installation and credentials authorized for this operation.

POST /prokrust.api.v1alpha1.LicensingService/ListLicenseWorkloads

Request headers​

HeaderValue and purpose
AuthorizationUse Bearer $PROKRUST_TOKEN for a Kubernetes caller authorized for this operation. Browser calls use the signed-in session.
Content-Typeapplication/json selects ProtoJSON for this unary request.
Connect-Protocol-Version1 selects version 1 of the Connect protocol.

Request fields​

ListLicenseWorkloadsRequest

JSON fieldTypeMeaning
scopeLicenseReportScopeRequired report scope. Choose NAMESPACE or INSTALLATION explicitly.
namespacestringRequired for namespace scope. Leave empty for installation scope.
pageSizeuint32Zero defaults to 100; maximum 500.
pageTokenstringOpaque token bound to scope, namespace, snapshot, ConfigMap resourceVersion and offset. Changed reports reject the page rather than mixing frames.
expectedSnapshotIdstringOptional first-page binding to a preceding GetLicenseStatus response. A different snapshot rejects with Aborted.

Example request​

Set PROKRUST_URL to the installation’s HTTPS origin and PROKRUST_TOKEN to your caller token. Replace the sample values with values from your installation.

curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $PROKRUST_TOKEN" \
-H 'Content-Type: application/json' \
-H 'Connect-Protocol-Version: 1' \
"$PROKRUST_URL/prokrust.api.v1alpha1.LicensingService/ListLicenseWorkloads" \
--data-binary @- <<'JSON'
{
"scope": "LICENSE_REPORT_SCOPE_NAMESPACE",
"namespace": "analytics",
"pageSize": 25,
"expectedSnapshotId": "59f75909-275c-54c4-8887-8e6bb6f0a3d9"
}
JSON

Response fields​

ListLicenseWorkloadsResponse

JSON fieldTypeMeaning
workloadslist of LicenseWorkloadUsageWorkload-level capacity observations included in this report page.
nextPageTokenstringOpaque continuation for the next page. Stop when it is empty.
snapshotIdstringOpaque collection-frame identifier. Use it to bind status and workload pages to the same snapshot.
generatedAtUnixSecondsuint64Report collection time in seconds since the Unix epoch.
collectionSuccessboolWhether the controller completed this collection frame successfully.
staleboolTrue when the collected data is too old, inconsistent in time, or from a failed collection.
scopeLicenseReportScopeScope of the collection frame that supplied this page.
namespacestringWorkspace for a namespace report. Empty for an installation-wide report.

Example response​

{
"workloads": [
{
"namespace": "analytics",
"kind": "TrainingRun",
"name": "train-values",
"uid": "91c90b29-d618-5dbf-bc4b-391c5aababcd",
"class": "LICENSE_WORKLOAD_CLASS_TRAINING",
"reserved": {
"cpuMillis": "2000"
},
"allocated": {
"cpuMillis": "1000"
},
"runningWorkers": 1
}
],
"scope": "LICENSE_REPORT_SCOPE_NAMESPACE",
"namespace": "analytics",
"snapshotId": "59f75909-275c-54c4-8887-8e6bb6f0a3d9",
"collectionSuccess": true,
"generatedAtUnixSeconds": "1778580000"
}