Skip to main content

clone

clone is a DTL operation that deep copies a subtree to a new path.

Use it when the original should remain and the new subtree should be independent.

YOp​

- clone:
from: config/production
to: config/staging

Parameters​

ParameterTypeRequiredDescription
fromstringyesSource path to copy.
tostringyesDestination path for the copy.

Behavior​

  • Requires the source path to exist.
  • Requires the destination path to be absent.
  • Performs a deep copy.
  • Leaves the original subtree unchanged.

Errors​

ErrorMeaning
PATH_NOT_FOUNDSource path does not exist.
ALREADY_EXISTSDestination path already exists.

Example​

yops:
- clone:
from: defaults
to: production

Input:

defaults:
timeout: 30

Output:

defaults:
timeout: 30
production:
timeout: 30