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.

ZFSResourceSnapshotPropertiesEntry

Type: object
No Additional Properties

Type

Type: object

(READ-ONLY): Type of ZFS dataset (filesystem, volume, etc).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

SourceValue

Type: object
No Additional Properties

Type

Type: enum (of string)

The source type.

Must be one of:
  • "NONE"
  • "DEFAULT"
  • "TEMPORARY"
  • "LOCAL"
  • "INHERITED"
  • "RECEIVED"

Value


The source value.

Type: string
Type: null
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Creation

Type: object

(READ-ONLY): Timestamp when dataset was created.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Used

Type: object

(READ-ONLY): Space used by dataset and descendants.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Referenced

Type: object

(READ-ONLY): Space referenced by this dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Compressratio

Type: object

(READ-ONLY): Property showing achieved compression ratio.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Createtxg

Type: object

(READ-ONLY): Transaction group when dataset was created.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Guid

Type: object

(READ-ONLY): Globally unique identifier for the dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Primarycache

Type: object

Controls primary cache usage (all, metadata, or none).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Secondarycache

Type: object

Controls secondary cache usage (all, metadata, or none).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Objsetid

Type: object

(READ-ONLY): Object set identifier for the dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Mlslabel

Type: object

Multi-level security label for the dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Refcompressratio

Type: object

(READ-ONLY): Compression ratio for referenced data.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Written

Type: object

(READ-ONLY): Space referenced since previous snapshot.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Logicalreferenced

Type: object

(READ-ONLY): Logical space referenced by dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Context

Type: object

SELinux security context for the dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Fscontext

Type: object

SELinux filesystem security context.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defcontext

Type: object

SELinux default security context for new files.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Rootcontext

Type: object

SELinux root directory security context.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Encryption

Type: object

Controls encryption cipher suite for the dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Encryptionroot

Type: object

(READ-ONLY): Property showing encryption root dataset.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Keystatus

Type: object

(READ-ONLY): Encryption key status (available/unavailable).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Redact Snaps

Type: object

(READ-ONLY): List of redaction snapshots.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Prefetch

Type: object

Controls prefetch behavior (all, metadata, or none).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Devices

Type: object

Controls whether device files can be opened.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Exec

Type: object

Controls whether programs can be executed from filesystem.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Setuid

Type: object

Controls setuid/setgid bit respect on executable files.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Xattr

Type: object

Controls extended attribute behavior (on, off, sa, dir).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Version

Type: object

(READ-ONLY): Filesystem version number.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Utf8Only

Type: object

Controls whether only UTF-8 filenames are allowed.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Normalization

Type: object

Unicode normalization property for filenames.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Casesensitivity

Type: object

Determines filename matching algorithm sensitivity.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Nbmand

Type: object

Controls non-blocking mandatory locking behavior.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Acltype

Type: object

Specifies type of ACL to use (off, nfsv4, posix).

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defaultuserquota

Type: object

Default space quota for new users.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defaultgroupquota

Type: object

Default space quota for new groups.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defaultprojectquota

Type: object

Default space quota for new projects.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defaultuserobjquota

Type: object

Default object quota for new users.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defaultgroupobjquota

Type: object

Default object quota for new groups.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Defaultprojectobjquota

Type: object

Default object quota for new projects.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null

Volsize

Type: object

Logical size of the volume.

No Additional Properties

Raw

Type: string

The raw value of the property.


The source from where this property received its value.

Type: object
Type: null

Value


The parsed raw value of the property.

Type: integer
Type: number
Type: string
Type: boolean
Type: null
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