Skip to main content
POST
Clone an application environment onto another cluster (browser session)

Authorizations

ankra_session
string
cookie
required

Browser session. Mutations also require X-Ankra-CSRF.

Path Parameters

application_id
string
required
environment_id
string
required

Body

application/json
target_cluster_id
string<uuid>
required

The cluster the copy runs on.

include_secrets
boolean
default:false

Copy the source's own secret overrides and suppressions onto the target.

prepare_database
boolean
default:false

Consent that the copy's deploy sets up the CloudNativePG operator the application's database needs when the target cluster has none, exactly as prepare_database on a deploy. Requires stacks.write on the target cluster.

environment_name
string | null

Name of the new environment (1 to 100 characters, no control characters). When given, the stored environment is created before anything else, the secrets are copied into its own scope, and the deploy binds to it; environment_id in the answer is then its id.

follow_branches
string[] | null

Branch patterns whose pushes the new environment follows, matched as a pipeline's when.branches. Needs environment_name. When given, the newest published build of a matching branch is deployed instead of the source's version; with none, the source's version is deployed and the first matching publish deploys. Absent or null is an environment updated by hand or by promotion; [] is refused.

Minimum array length: 1
source_cluster_id
string<uuid> | null

Which placement of a multi-cluster source environment to copy; absent copies the oldest one.

copy_operating_settings
boolean | null
default:true

Copy the source environment's own who-runs-it layer, its operating expectations and its backup protection onto a named clone, each through its own write and checks (never widening what the new environment inherits). Absent or null is true. Skipped, not refused, for a caller without applications.write. An unnamed clone copies none.

Response

The deploy the clone queued and the secret keys it wrote.

copied_secrets
string[]
required

Override keys written to the target.

inherited_secrets
string[]
required

Target override keys returned to the shared value.

installation_id
string
required
message
string
required
operation_id
string
required
source_cluster_id
string
required
status
string
required
suppressed_secrets
string[]
required

Keys suppressed on the target, as on the source.

copied_operating_settings
enum<string>[]
required

The operating settings copied onto the new environment. Empty when none were.

Available options:
autonomy,
operating_expectations,
backup_protection
operating_settings_not_copied
object[]
required

Each operating setting the clone was refused, with the sentence that says why. Who runs it (autonomy) is refused to a caller confined to a project when the new environment also runs on a cluster outside that project; the sentence names nothing of that cluster. Empty when nothing was refused.

backup_protection
enum<string> | null
required

What became of the source deployment's backup protection: pending when the deploy that creates the new stack arms the database-backup default, not_copied when the source is protected (or its protection could not be read) and the new deployment will not be. Null when the source is not protected or no operating settings were copied.

Available options:
armed,
pending,
not_copied
environment_id
string

The new environment: its stored id when the clone named it, otherwise the target cluster's id.

environment_name
string | null

The new environment's name; null when the clone named none.

follow_branches
string[] | null

The new environment's branch rule; null when it is updated by hand or by promotion.

image_branch
string

The branch whose newest published build the first deploy runs. Absent when it runs the source environment's version.

image_tag
string

The image tag the first deploy runs: the newest matching branch build, or the source's version. Empty when neither pins one.

rule_has_no_build
boolean

True when follow_branches matches no published branch build yet: the source's version runs until a matching branch publishes one. Absent otherwise.

warnings
string[]