Skip to main content

move

move is a DTL operation that relocates a subtree from one path to another.

Use it when information should change location and the original location should be removed.

YOp

- move:
from: config/old_db
to: config/database

Parameters

ParameterTypeRequiredDescription
fromstringyesSource path to read and remove.
tostringyesDestination path to create.

Behavior

  • Requires the source path to exist.
  • Requires the destination path to be absent.
  • Removes the source after creating the destination.
  • Rejects moving a path into its own subtree.

Errors

ErrorMeaning
PATH_NOT_FOUNDSource path does not exist.
ALREADY_EXISTSDestination path already exists.
INVALID_PATHDestination is inside the source subtree.

Example

yops:
- move:
from: config/old_db
to: config/database

Input:

config:
old_db:
host: localhost

Output:

config:
database:
host: localhost