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.

Args: data: Count parameters containing: - paths: List of dataset paths to count snapshots for. If empty, counts snapshots for root filesystems only. - recursive: Include snapshots from child datasets in counts.

Returns: Dict mapping dataset names to their snapshot counts.

Examples: # Count snapshots for root filesystems only count({})

# Count all snapshots recursively count({“recursive”: True})

# Count snapshots for a specific dataset count({“paths”: [“tank/data”]})

# Count snapshots for a dataset and all children count({“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 to count snapshots for. If empty, counts all snapshots.

All items must be unique

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

Recursive

Type: boolean Default: false

Include snapshots from child datasets when counting.

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