Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Get a tenant's usage

Returns what one tenant used hour by hour, with the hour in progress and the totals. Usage is in raw counts by meter. The totals are also split by package and by luna type.

GET/_luna/tenants/{tenant}/usage
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:usage:read
Path parameters
tenantstringrequired

The tenant, by its name.

Query parameters
sinceinteger<int64>

Usage from this moment on, in milliseconds since the Unix epoch. 31 days before until when left out.

min 0
untilinteger<int64>

Usage up to this moment, in milliseconds since the Unix epoch. Now when left out.

min 0
Responses
200

The tenant's usage.

tenantstringrequired
hoursUsageHour[]required

Each hour that has ended, oldest first.

Show properties
Array of UsageHour
hourinteger<int64>required

The hour's number, counted from the Unix epoch.

min 0
startMsinteger<int64>required

When the hour starts, in milliseconds since the Unix epoch.

min 0
usageobjectrequired

What was used in the hour, as raw counts by meter.

currentHourobjectrequired

The hour in progress, as raw counts by meter.

totalsobjectrequired

Every hour added up, as raw counts by meter.

packagesobjectrequired

The totals for each package the tenant uses, by package and then by meter.

typesobjectrequired

The totals for each luna type, by type and then by meter.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://luna.example.com/_luna/tenants/string/usage' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "tenant": "string",
  "hours": [
    {
      "hour": 0,
      "startMs": 0,
      "usage": {
        "property1": 0,
        "property2": 0
      }
    }
  ],
  "currentHour": {
    "property1": 0,
    "property2": 0
  },
  "totals": {
    "property1": 0,
    "property2": 0
  },
  "packages": {
    "property1": {
      "property1": 0,
      "property2": 0
    },
    "property2": {
      "property1": 0,
      "property2": 0
    }
  },
  "types": {
    "property1": {
      "property1": 0,
      "property2": 0
    },
    "property2": {
      "property1": 0,
      "property2": 0
    }
  }
}

Was this page helpful?