Files
nomad/website/content/api-docs/operator/utilization.mdx
Tim Gross 8a5a057d88 offline license utilization reporting (#25844)
Nomad Enterprise users operating in air-gapped or otherwise secured environments
don't want to send license reporting metrics directly from their
servers. Implement manual/offline reporting by periodically recording usage
metrics snapshots in the state store, and providing an API and CLI by which
cluster administrators can download the snapshot for review and out-of-band
transmission to HashiCorp.

This is the CE portion of the work required for implemention in the Enterprise
product. Nomad CE does not perform utilization reporting.

Ref: https://github.com/hashicorp/nomad-enterprise/pull/2673
Ref: https://hashicorp.atlassian.net/browse/NMD-68
Ref: https://go.hashi.co/rfc/nmd-210
2025-05-14 09:51:13 -04:00

60 lines
1.8 KiB
Plaintext

---
layout: api
page_title: Utilization - Operator - HTTP API
description: |-
The /operator/utilization endpoints provide tools for generating utilization reporting bundles for Nomad Enterprise.
---
# Operator Utilization HTTP API
The `/operator/utilization` endpoints provide tools for generating utilization
reporting bundles for Nomad Enterprise.
<EnterpriseAlert />
## Generate Nomad Enterprise Utilization Report Buindle
This endpoint generates a utilization report. If Nomad did not record a
utilization snapshot in the previous 24 hours, Nomad records a utilization
snapshot first.
| Method | Path | Produces |
|--------|----------------------------|--------------------|
| `POST` | `/v1/operator/utilization` | `application/json` |
This table shows this endpoint's support for [blocking queries][] and
[required ACLs][].
| Blocking Queries | ACL Required |
|------------------|------------------|
| `NO` | `operator:write` |
### Parameters
- `today` `(bool: false)` - Specifies to return a bundle that only includes
utilization snapshots from the previous 24 hours.
### Sample Request
```shell-session
$ curl -XPOST \
https://localhost:4646/v1/operator/utilization?today=true
```
### Sample Response
The `Bundle` field in the response body is a base64-encoded blob. The exact
format of this blog is not part of the Nomad API and is subject to change
between versions. The [`nomad operator utilization`][] command, which uses this
API, decodes this to a human-readable file in the current working directory.
```json
{
"Bundle": "eyJ2ZXJzaW9uIjoiMiIsIm1vZGUiOiJtYW51Y..."
}
```
[blocking queries]: /nomad/api-docs#blocking-queries
[required ACLs]: /nomad/api-docs#acls
[`nomad operator utilization`]: /nomad/docs/command/operator/utilization