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

Fork a luna

Makes a new luna that starts from another luna’s data, as it is now or as it was at an earlier moment. The new luna has its own key, in the same tenant or in another one. Reading the source needs data:read on its tenant, and writing the copy needs data:write on the tenant it goes to.

POST/_luna/tenants/{tenant}/fork
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 the source luna is in, by its full name.

Request body
requiredapplication/json
typestringrequired

The luna type.

keyobjectrequired

The key of the luna to fork, such as {"id": "a"}.

toKeyobjectrequired

The key of the new luna.

atinteger<int64> | null

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

min 0
toTenantstring | null

The tenant the new luna goes to, by its full name. The same tenant when left out.

schedulesboolean

Whether the new luna keeps the schedules its source has.

Responses
200

The luna is forked.

sandboxesinteger<int64> | null

How many saved sandboxes came with the luna. Left out for a luna type with no sandboxes.

min 0
sandboxErrorstring | null

Why the luna's sandboxes could not be copied. The luna itself is forked all the same.

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' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "string",
  "key": {},
  "toKey": {},
  "at": 0,
  "toTenant": "string",
  "schedules": true
}'
Response
{
  "sandboxes": 0,
  "sandboxError": "string"
}