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.

Invalid input is returned to the client as a JSON-RPC error response (code -32602, Invalid params); each failing condition appears in the error’s data.extra array with its own errno. A validation error is raised when:

  • the snapshot does not exist

  • the hold cannot be created

Examples:

Hold a snapshot:

{"path": "tank/data@backup"}

Hold with a custom tag:

{"path": "tank/data@backup", "tag": "replication"}

Hold matching snapshots in child datasets:

{"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