zfs.resource.snapshot.hold

Create a hold on a ZFS snapshot.

A hold prevents a snapshot from being destroyed. Multiple holds can be placed on a snapshot with different tags.

Args: data: Hold parameters containing: - path: Snapshot path to hold (e.g., ‘pool/dataset@snapshot’). - tag: Hold tag name (default: ‘truenas’). - recursive: Apply hold to matching snapshots in child datasets.

Returns: None on success.

Raises: ValidationError: If snapshot not found or hold creation fails.

Examples: # Hold a single snapshot hold({“path”: “tank/data@backup”})

# Hold with custom tag hold({“path”: “tank/data@backup”, “tag”: “replication”})

# Hold recursively hold({“path”: “tank@backup”, “recursive”: True})

Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: data

data

Type: object

Hold parameters for holding ZFS snapshots.

No Additional Properties

Path

Type: string

Snapshot path to hold (e.g., 'pool/dataset@snapshot').

Must be at least 1 characters long

Tag

Type: string Default: "truenas"

Hold tag name to apply.

Recursive

Type: boolean Default: false

Apply hold recursively to matching snapshots in child datasets.

Result

Type: null


Required roles: SNAPSHOT_WRITE