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

Copy every luna to another tenant

Copies the lunas of a tenant into another tenant, as they are now or as they were at an earlier moment. A destination with nothing deployed gets the source’s code and settings first. One request copies one page of lunas. Send the cursor it returns to copy the next page, until the cursor is null. Reading the source needs data:read on its tenant, and writing the copies needs data:write on the destination.

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

The tenant to copy from, by its full name.

Request body
requiredapplication/json
tostringrequired

The tenant to copy into, by its full name.

atinteger<int64> | null

The moment to copy the lunas as of, in milliseconds since the Unix epoch. Now when left out.

min 0
schedulesboolean

Whether each copy keeps the schedules its source has.

cursorobject | null

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

limitinteger<int32> | null

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

min 0
Responses
200

What this page copied.

copiedinteger<int32>required

How many lunas this page copied.

min 0
skippedinteger<int32>required

How many lunas this page passed over: those that did not exist yet at that moment, and those an earlier try already copied.

min 0
cursorTypeCursor | null
Show properties
One of:
TypeCursor
typestringrequired

The luna type the next page starts in.

afterobject | null

Where the next page starts within that type. Null for its start.

null
null
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/fork-all' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": "string",
  "at": 0,
  "schedules": true,
  "cursor": {},
  "limit": 0
}'
Response
{
  "copied": 0,
  "skipped": 0,
  "cursor": {
    "type": "string",
    "after": {}
  }
}

Was this page helpful?