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

Deploy source files to a tenant

Builds source files and deploys them to a tenant you added to an environment. Luna builds the files inside the tenant’s own isolation boundary, previews the change and then deploys it. This is how a platform runs code that its customers write. To deploy to an environment’s default tenant, use POST /_luna/deploy.

POST/_luna/tenants/{tenant}/deploy
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:write
Path parameters
tenantstringrequired

The tenant, by its full name.

Request body
requiredapplication/json
filesobjectrequired

Each file's path, relative and separated by /, with its contents as UTF-8 text.

entrystring | null

The entry module's path. When left out, Luna reads the config file or looks for a default entry module.

confirmboolean

Deploy even though the preview lists changes that need your say-so.

Responses
200

The files are deployed.

deployedbooleanrequired

Whether the files were deployed. The fields about the new version are left out when they were not.

versioninteger<int64> | null

The version the tenant now runs.

min 0
lunasLunaInfo[] | null

The luna types the version defines.

Show properties
Array of LunaInfo
namestringrequired
visibilitystringrequired

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

keystring[]required

The names of the fields of its key.

handlersstring[]required

The names of its handlers.

publishableKeystring | null

The tenant's main publishable key.

apiTokenstring | null

The tenant's main secret token.

previewDeployPreviewrequired

What the deploy changes, and what blocked it when it was not deployed.

Show properties
changesstring[]required

Every change, one line each.

blockedstring[]required

Why this cannot be deployed. Empty when it can.

confirmstring[]required

What needs your say-so before it is deployed.

deletesstring[]required

Data that deploying leaves behind or deletes.

dryRunDryRun[]required

A trial of the new version's migration on copies of a sample of each changed luna type's lunas.

Show properties
Array of DryRun
typestringrequired

The luna type.

reportDryRunReportrequired

How a migration's trial went.

Show properties
sampledinteger<int64>required

How many lunas the migration was tried on.

min 0
failuresLunaFailure[]required

The lunas it failed on.

Show properties
Array of LunaFailure
keyobjectrequired

The luna's key.

errorstringrequired

What went wrong.

pendingMessagesinteger<int64>required

Messages that wait for a handler the new version removes or changes.

min 0
pendingSchedulesinteger<int64>required

Schedules that wait for a handler the new version removes or changes.

min 0
changedHandlersobjectrequired

The handlers the new version removes or changes, by luna type.

urlstring | null

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

409

Nothing was deployed. The preview says what blocks the deploy or needs confirm.

deployedbooleanrequired

Whether the files were deployed. The fields about the new version are left out when they were not.

versioninteger<int64> | null

The version the tenant now runs.

min 0
lunasLunaInfo[] | null

The luna types the version defines.

Show properties
Array of LunaInfo
namestringrequired
visibilitystringrequired

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

keystring[]required

The names of the fields of its key.

handlersstring[]required

The names of its handlers.

publishableKeystring | null

The tenant's main publishable key.

apiTokenstring | null

The tenant's main secret token.

previewDeployPreviewrequired

What the deploy changes, and what blocked it when it was not deployed.

Show properties
changesstring[]required

Every change, one line each.

blockedstring[]required

Why this cannot be deployed. Empty when it can.

confirmstring[]required

What needs your say-so before it is deployed.

deletesstring[]required

Data that deploying leaves behind or deletes.

dryRunDryRun[]required

A trial of the new version's migration on copies of a sample of each changed luna type's lunas.

Show properties
Array of DryRun
typestringrequired

The luna type.

reportDryRunReportrequired

How a migration's trial went.

Show properties
sampledinteger<int64>required

How many lunas the migration was tried on.

min 0
failuresLunaFailure[]required

The lunas it failed on.

Show properties
Array of LunaFailure
keyobjectrequired

The luna's key.

errorstringrequired

What went wrong.

pendingMessagesinteger<int64>required

Messages that wait for a handler the new version removes or changes.

min 0
pendingSchedulesinteger<int64>required

Schedules that wait for a handler the new version removes or changes.

min 0
changedHandlersobjectrequired

The handlers the new version removes or changes, by luna type.

urlstring | null

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

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
Bodyapplication/json
Request
curl -X POST 'https://luna.example.com/_luna/tenants/string/deploy' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "files": {
    "property1": "string",
    "property2": "string"
  },
  "entry": "string",
  "confirm": true
}'
Response
{
  "deployed": true,
  "version": 0,
  "lunas": [
    {
      "name": "string",
      "visibility": "string",
      "key": [
        "string"
      ],
      "handlers": [
        "string"
      ]
    }
  ],
  "publishableKey": "string",
  "apiToken": "string",
  "preview": {
    "changes": [
      "string"
    ],
    "blocked": [
      "string"
    ],
    "confirm": [
      "string"
    ],
    "deletes": [
      "string"
    ],
    "dryRun": [
      {
        "type": "string",
        "report": {
          "sampled": 0,
          "failures": [
            {
              "key": {},
              "error": "string"
            }
          ],
          "pendingMessages": 0,
          "pendingSchedules": 0
        }
      }
    ],
    "changedHandlers": {
      "property1": [
        "string"
      ],
      "property2": [
        "string"
      ]
    }
  },
  "url": "string"
}

Was this page helpful?