Reference For: developers

API: usage

Operations of the usage tag of the native REST API.

Usage ledger for chargeback: vCPU, memory, storage and network per VM, tenant and day

GET /v1/usage

The usage ledger over a date range, grouped by VM, tenant, resource pool, folder or host, per day, month or for the whole range; scope restricts it to the VMs of one container. format=csv answers text/csv.

CLI
kyvernon usage report --from <date> --to <date>

Parameters

NameInTypeRequiredDescription
fromquerystringyesFirst day, YYYY-MM-DD (UTC).
toquerystringyesLast day, inclusive.
groupByquerystring or nullvm (default), tenant, resourcePool, folder or host.
periodquerystring or nullday (default), month or total.
formatquerystring or nulljson (default) or csv.
scopequerystring or nullContainer id (datacenter, folder, cluster, host, resource pool, datastore or network): only the VMs in it count, with the same rule as GET /v1/inventory/vms?scope=. Tenant, pool, folder and host lines are then computed over those VMs only. Requires System.View on the container.

Responses

StatusDescriptionSchema
200JSON, or text/csv with format=csvUsageReportView
400Bad date, range, group, period, format or scope (error.usage_*)ErrorBody
403Permission denied; args.privilege names the missing privilegeErrorBody
404The scope container does not existErrorBody

GET /v1/usage/days/{day}

The usage summary of one day (the document pushed to webhooks).

CLI
kyvernon usage day <date>

Parameters

NameInTypeRequiredDescription
daypathstringyesYYYY-MM-DD (UTC)

Responses

StatusDescriptionSchema
200OKDailySummaryView
400Invalid argument; the error body names the fieldErrorBody

Version 0.1.