zfs.resource.snapshot.count

Count ZFS snapshots per dataset.

This method provides a fast way to count snapshots without retrieving full snapshot information. Useful for UI displays and quota checks.

A snapshot path counts that snapshot toward its dataset. A path that does not exist is skipped.

Examples:

Count snapshots for root filesystems only:

{}

Count all snapshots recursively:

{"recursive": true}

Count snapshots for a specific dataset:

{"paths": ["tank/data"]}

Count snapshots for a dataset and all of its children:

{"paths": ["tank"], "recursive": true}
Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: data

data

Type: object Default: {"paths": [], "recursive": false}

Count parameters for counting ZFS snapshots.

No Additional Properties

Paths

Type: array of string Default: []

Dataset paths, which select the snapshots of that dataset, and snapshot paths (dataset@snapshot), which select that one snapshot. A path that does not exist is skipped. When empty, the root filesystem of every imported pool is used.

All items must be unique

No Additional Items
Each item of this array must be:
Type: string

Recursive

Type: boolean Default: false

Also include the snapshots of the descendants of each dataset path, or of every pool's root filesystem when paths is empty.

Result

Type: object

Mapping of dataset names to their snapshot counts.

Each additional property must conform to the following schema

Type: integer


Required roles: SNAPSHOT_READ