zfs.resource.snapshot.query

This method provides an interface for retrieving information about ZFS snapshots, including their properties and user properties.

Args: data: Query parameters containing: - paths: List of dataset or snapshot paths to query. If empty, queries all. - properties: List of ZFS properties to retrieve. Empty list = defaults, None = none. - get_user_properties: Whether to include user-defined properties. - get_source: Whether to include property source information. - recursive: Include snapshots from child datasets. - min_txg: Minimum transaction group filter (0 = no minimum). - max_txg: Maximum transaction group filter (0 = no maximum).

Returns: List of snapshot entries with requested properties.

Examples: # Query all snapshots query({})

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

# Query a specific snapshot query({“paths”: [”tank/data@backup”]})

# Query with recursion and specific properties query({ “paths”: [“tank”], “recursive”: True, “properties”: [“used”, “referenced”, “creation”] })

Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: data

data

Type: object
Default:
{ "paths": [], "recursive": false, "properties": [], "get_user_properties": false, "get_source": false, "get_holds": false, "min_txg": 0, "max_txg": 0 }

Query parameters for retrieving ZFS snapshot information.

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.

Properties

Default: []

List of ZFS properties to retrieve. Empty list returns default properties. None returns no properties.

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

Get User Properties

Type: boolean Default: false

Retrieve user-defined properties for snapshots.

Get Source

Type: boolean Default: false

Include source information for each property value.

Get Holds

Type: boolean Default: false

Include holds information (if any) for the snapshot.

Min Txg

Type: integer Default: 0

Minimum transaction group for filtering snapshots. 0 means no minimum.

Max Txg

Type: integer Default: 0

Maximum transaction group for filtering snapshots. 0 means no maximum.

Result

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

ZFSResourceSnapshotEntry

Type: object
No Additional Properties

Createtxg

Type: integer

The TXG in which the snapshot was created.

Guid

Type: integer

A GUID for the snapshot.

Name

Type: string

The zfs resource for the given snapshot.

Pool

Type: string

The zpool of the snapshot.

Dataset

Type: string

The zfs resource for the given snapshot.

Snapshot Name

Type: string

The name of the snapshot.

Type

Type: const Default: "SNAPSHOT"

The type of zfs resource.

Specific value: "SNAPSHOT"

Holds


A list of tags that hold the snapshot.

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


Requested properties for the snapshot.

Type: object
Type: null

User Properties


User-defined properties for snapshots.

Type: object

Each additional property must conform to the following schema

Type: string
Type: null


Required roles: SNAPSHOT_READ