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

Get a tenant

Returns a tenant: the version it runs, its settings, the limits that hold for it, its usage counters and the luna types its code defines.

GET/_luna/tenants/{tenant}
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:tenants:read
Path parameters
tenantstringrequired

The tenant, by its full name.

Responses
200

The tenant.

tenantstringrequired

The tenant's full name.

urlstring | null

The address its app is served at. Null when the deployment has no app domain.

routesUrlstring | null

Where its handlers' HTTP routes are served. Left out when it has none, or the deployment has no app domain.

versioninteger<int64>required

The version it runs. 0 before its first deploy.

min 0
runningbooleanrequired

Whether its workers are running on the server that answered.

configTenantSettingsrequired

Its settings. The headers of a telemetry export are masked.

Show properties
quotasTenantQuotas

The most a tenant can use. A limit that is null or left out is not set here, so the plan's limit holds.

default: {"cpuPercent":null,"requestsPerSecond":null,"sandboxes":null,"storageBytes":null}
Show properties
requestsPerSecondnumber<double> | null

The most requests a second.

default: null
cpuPercentinteger<int32> | null

The most CPU the tenant's microVM can use, as a percent of one core.

min 0 · default: null
storageBytesinteger<int64> | null

The most storage, in bytes.

min 0 · default: null
sandboxesinteger<int32> | null

The most sandboxes running at once.

min 0 · default: null
lunaMemoryMibinteger<int64> | null

The most memory one luna can declare or use, in MiB.

min 0 · default: null
lunaCpunumber<double> | null

The most cores one luna can declare or use.

default: null
lunaDefaultMemoryMibinteger<int64> | null

The memory a luna has when it declares none, in MiB.

min 0 · default: null
lunaDefaultCpunumber<double> | null

The cores a luna has when it declares none.

default: null
tenantMemoryMibinteger<int64> | null

The most memory the tenant's microVM can grow to, in MiB.

min 0 · default: null
lunaReserveboolean | null

Whether the tenant's lunas can reserve their limits. The plan decides when left out.

default: null
hostnamesstring[]

Custom routes to the tenant, each as host or host/first-path-segment.

default: []
grantsobject

The platform luna types the tenant's code can call, each under the service name the code uses.

default: {}
outboundOutboundHandler | null
default: null
Show properties
One of:
OutboundHandler
lunastringrequired

The platform's luna type.

keyobjectrequired

The key of the luna to call.

handlerstringrequired

The handler to call.

null
null
retentionDaysinteger<int32> | null

How many days the tenant's logs and traces are kept. The deployment's setting holds when left out.

min 0 · default: null
historyDaysinteger<int32> | null

How many days back the tenant's lunas can be restored or forked. At most what its plan keeps, which is the default. A change takes effect when its workers next start.

min 0 · default: null
otlpOtlpConfig | null
default: null
Show properties
One of:
OtlpConfig
endpointstringrequired

The base URL of an OTLP collector. Luna adds /v1/logs and the other OTLP paths to it.

headersobject

Headers sent with every request, usually an API key. A response shows each value as ***.

null
null
labelsobject

Your own tags, for finding and grouping tenants. Left out of a response when there are none.

default: {}
hostLabelstring | null

The label of the tenant's public hostname, <label>.<app domain>. Luna sets it once. A request cannot change it.

default: null
ceilingsTenantCeilingsrequired

The limits that hold for a tenant, all things considered: the lowest of its own settings, its environment's and its plan's. A limit that is left out is not set at any level.

Show properties
lunaMemoryMibinteger<int64> | null

The most memory one luna can declare or use, in MiB.

min 0
lunaCpunumber<double> | null

The most cores one luna can declare or use.

tenantMemoryMibinteger<int64> | null

The most memory the tenant's microVM can grow to, in MiB.

min 0
lunaDefaultMemoryMibinteger<int64> | null

The memory a luna has when it declares none, in MiB.

min 0
lunaDefaultCpunumber<double> | null

The cores a luna has when it declares none.

lunaReserveboolean | null

Whether lunas can reserve their limits.

historyDaysinteger<int32> | null

The days of history the plan keeps.

min 0
usageTenantCountersrequired

A tenant's live counters on the server that answered. For billed usage, read the usage routes.

Show properties
requestsinteger<int64>required

Requests the tenant has answered.

min 0
storageBytesinteger<int64> | null

The storage it uses, in bytes. Null when it has not been measured yet.

min 0
outboundRequestsinteger<int64>required

Outgoing requests its code has made.

min 0
outboundBytesinteger<int64>required

Bytes its outgoing requests have moved.

min 0
lunaTypesLunaTypeItem[]required

The luna types its deployed version defines. Empty before a first deploy.

Show properties
Array of LunaTypeItem
namestringrequired
indexbooleanrequired

Whether the type is an index, which Luna keeps from other types' data.

languagestringrequired

typescript or python.

packagestring | null

The package the type comes from, when it comes from one.

visibilitystringrequired

public when clients with a publishable key can call it, private otherwise.

keystring[]required

The names of the fields of its key.

handlersintegerrequired

How many handlers it has.

min 0
handlerNamesstring[]required

The names of its handlers.

cronsintegerrequired

How many schedules it has.

min 0
streamsintegerrequired

How many streams it has.

min 0
memoryMibinteger<int64> | null

The memory the type declares for a luna, in MiB. Null when it declares none.

min 0
cpunumber<double> | null

The cores the type declares for a luna. Null when it declares none.

reservebooleanrequired

Whether its lunas reserve their limits.

sizeLunaSizerequired

The size a luna of a type has: what the type declares, or the default for the tenant.

Show properties
memoryMibinteger<int64> | null

Memory in MiB.

min 0
cpunumber<double> | null

Cores.

definitionLunaDefinitionrequired

What a luna type's code defines, as its manifest says it. Luna's own handlers are left out.

Show properties
keyobject[]required

The fields of its key, each with a name and a type.

visibilitystringrequired

public when clients with a publishable key can call it, private otherwise.

idleTimeoutMsinteger<int64>required

How long a luna stays awake when nothing calls it, in milliseconds.

min 0
handlersobject[]required

Its handlers, each with its name, description, args, returns and errors, and whether it is a query, durable or exclusive.

tablesobject[]required

Its tables, each with its name, columns, primaryKey, singleRow and search.

sandboxesobject | null

The sandboxes it declares, by name.

bucketsobject | null

The buckets of files it declares, by name.

isolatesobject | null

The isolates it declares, by name.

streamsobjectrequired

Its streams, by name, each with the type of its entries and its retention.

schedulesobject[]required

Its schedules, each with its name, schedule, handler, tz, args, onMissed and overlap.

listenobject[] | null

What it listens to, each entry naming a table's changes or an event.

indexbooleanrequired

Whether the type is an index.

wakesTenantWakesrequired

Its lunas' wake-ups to come (their timers, schedules and retries).

Show properties
nextWakeinteger<int64> | null

When the first is due, in ms since the epoch. Null when none is, or when this server does not know (the tenant runs elsewhere).

min 0
typesobject[] | null

By luna type, while its workers run on the server that answered: {lunaType, lunas, nextWake, deployed}. A type its deployed version no longer defines (deployed: false) keeps its lunas' times but wakes none of them. Left out while it is stopped.

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' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "tenant": "string",
  "url": "string",
  "routesUrl": "string",
  "version": 0,
  "running": true,
  "config": {
    "quotas": {
      "cpuPercent": null,
      "requestsPerSecond": null,
      "sandboxes": null,
      "storageBytes": null
    },
    "hostnames": [],
    "grants": {},
    "outbound": null,
    "retentionDays": null,
    "historyDays": null,
    "otlp": null,
    "labels": {},
    "hostLabel": null
  },
  "ceilings": {
    "lunaMemoryMib": 0,
    "lunaCpu": 0,
    "tenantMemoryMib": 0,
    "lunaDefaultMemoryMib": 0,
    "lunaDefaultCpu": 0,
    "lunaReserve": true,
    "historyDays": 0
  },
  "usage": {
    "requests": 0,
    "storageBytes": 0,
    "outboundRequests": 0,
    "outboundBytes": 0
  },
  "lunaTypes": [
    {
      "name": "string",
      "index": true,
      "language": "string",
      "package": "string",
      "visibility": "string",
      "key": [
        "string"
      ],
      "handlers": 0,
      "handlerNames": [
        "string"
      ],
      "crons": 0,
      "streams": 0,
      "memoryMib": 0,
      "cpu": 0,
      "reserve": true,
      "size": {
        "memoryMib": 0,
        "cpu": 0
      },
      "definition": {
        "key": [
          {}
        ],
        "visibility": "string",
        "idleTimeoutMs": 0,
        "handlers": [
          {}
        ],
        "tables": [
          {}
        ],
        "sandboxes": {},
        "buckets": {},
        "isolates": {},
        "streams": {},
        "schedules": [
          {}
        ],
        "listen": [
          {}
        ],
        "index": true
      }
    }
  ],
  "wakes": {
    "nextWake": 0,
    "types": [
      {}
    ]
  }
}

Was this page helpful?