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

Restore lunas to an earlier moment

Puts lunas back as they were at a moment in the past: one luna, every luna of a type or every luna of the tenant. One request restores one page of lunas. Send the cursor it returns to restore the next page, until the cursor is null.

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

The tenant, by its full name.

Request body
requiredapplication/json
atinteger<int64> | null

The moment to restore to, in milliseconds since the Unix epoch. Give this or lsn.

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

A position in one luna's history to restore to. Needs type and key.

min 0 · default: null
typestring | null

Only lunas of this type. Every type when left out.

default: null
keyobject | null

Only the luna with this key, such as {"id": "a"}. Needs type.

limitinteger<int32> | null

How many lunas to restore in this request. 64 when left out, 1000 at most.

min 0 · default: null
cursorobject | null

The cursor of the last page, to restore the next one.

Responses
200

What this page restored.

restoredinteger<int64>required

How many lunas this page restored.

min 0
skippedinteger<int64>required

How many lunas this page passed over because they did not exist yet at that moment.

min 0
failedLunaFailure[]required

The lunas that could not be restored. Send the request again for those.

Show properties
Array of LunaFailure
keyobjectrequired

The luna's key.

errorstringrequired

What went wrong.

cursorobject | null

Send this as cursor to restore the next page. Null when the restore is finished.

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/restore' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "at": null,
  "lsn": null,
  "type": null,
  "key": {},
  "limit": null,
  "cursor": {}
}'
Response
{
  "restored": 0,
  "skipped": 0,
  "failed": [
    {
      "key": {},
      "error": "string"
    }
  ],
  "cursor": {}
}

Was this page helpful?