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

Preview a deploy

Says what deploying an app would do, without deploying it: every change, what blocks the deploy, what needs your say-so and what data it would leave behind. Where the new version migrates data, Luna also tries the migration on copies of a sample of real lunas.

POST/_luna/preflight
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:deploy:write
Request body
requiredapplication/json
tenantstringrequired

The tenant to deploy to, by its full name.

entriesstring[]required

The entry modules, relative to the app's root. At most one for each language. One path as a string works too, and so does the name entry.

manifestsobject

The manifest of each entry module, by its path, as the SDK's build reports it.

filesobject

The files of a small app: each path, relative and separated by /, with its contents as UTF-8 text.

treeobject

The files of an app that were uploaded before this request, each path with its hash and size.

Responses
200

What the deploy would do.

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.

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
Bodyapplication/json
Request
curl -X POST 'https://luna.example.com/_luna/preflight' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "tenant": "string",
  "entries": [
    "string"
  ],
  "manifests": {
    "property1": {},
    "property2": {}
  },
  "files": {
    "property1": "string",
    "property2": "string"
  },
  "tree": {
    "property1": {
      "sha256": "string",
      "size": 0
    },
    "property2": {
      "sha256": "string",
      "size": 0
    }
  }
}'
Response
{
  "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"
    ]
  }
}

Was this page helpful?