Create an environment
Creates an environment in a project, empty or as a copy of another. A copy takes the code of from, and its data when data is set, which also needs data:read on the source. Secrets are never copied.
/_luna/orgs/{org}/projects/{project}/environmentsAuthorizationBearer token · headerrequiredAn account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.
environments:writeorgstringrequiredThe organisation, by its slug.
projectstringrequiredThe project, by its slug.
application/jsonnamestringrequiredLower-case letters, digits and single dashes. production is taken.
fromstring | nullAn environment to copy the code from, by its name or its id. Leave it out for an empty environment.
expiresIninteger<int64> | nullSeconds from now until the environment is deleted. Leave it out for one that stays.
databooleanWith from, copies the data of its lunas as well as its code.
The new environment.
idstringrequirednamestringrequiredtenantstringrequiredThe environment's default tenant. Deploys, secrets, keys and telemetry name it.
createdMsinteger<int64>requiredcreatedBystringrequiredWho made it: an email address or a key's label.
expiresMsinteger<int64> | nullWhen it is deleted, in milliseconds since the Unix epoch. Null when it stays.
fromstring | nullThe environment it was copied from.
copyCopyProgress | nullShow propertiesHide properties
fromstringrequiredThe environment the data comes from.
statestringrequiredcounting, copying, done or failed.
atMsinteger<int64>requiredThe moment of the source the copy is of, in milliseconds since the Unix epoch.
totalinteger<int64> | nullHow many lunas there are to copy. Null until they have been counted.
doneinteger<int64>requiredHow many lunas are dealt with: copied or skipped.
copiedinteger<int64>requiredskippedinteger<int64>requiredLunas passed over because they were made after atMs or copied by an earlier try.
errorstring | nullWhy a failed copy stopped.
startedMsinteger<int64>requiredfinishedMsinteger<int64> | nullnullversioninteger<int64> | nullThe version of the code copied into it, when it was made from another environment.
The request failed. The status says how and error.message says why.
errorErrorDetailrequiredShow propertiesHide properties
codestring | nullA code for programs to branch on, when the error has one.
messagestringrequiredWhat went wrong, in a sentence a person can read.