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”] })
No Additional Items
Tuple Validation
Parameter 1: data
data
Type: objectQuery parameters for retrieving ZFS snapshot information.
No Additional PropertiesPaths
Type: array of string Default: []Dataset paths to count snapshots for. If empty, counts all snapshots.
All items must be unique
No Additional ItemsEach item of this array must be:
Recursive
Type: boolean Default: falseInclude snapshots from child datasets when counting.
Properties
Default: []List of ZFS properties to retrieve. Empty list returns default properties. None returns no properties.
No Additional Items
Each item of this array must be:
Get User Properties
Type: boolean Default: falseRetrieve user-defined properties for snapshots.
Get Source
Type: boolean Default: falseInclude source information for each property value.
Get Holds
Type: boolean Default: falseInclude holds information (if any) for the snapshot.
Min Txg
Type: integer Default: 0Minimum transaction group for filtering snapshots. 0 means no minimum.
Max Txg
Type: integer Default: 0Maximum transaction group for filtering snapshots. 0 means no maximum.
Result
Type: array of objectNo Additional Items
Each item of this array must be:
ZFSResourceSnapshotEntry
Type: objectNo Additional Properties
Createtxg
Type: integerThe TXG in which the snapshot was created.
Guid
Type: integerA GUID for the snapshot.
Name
Type: stringThe zfs resource for the given snapshot.
Pool
Type: stringThe zpool of the snapshot.
Dataset
Type: stringThe zfs resource for the given snapshot.
Snapshot Name
Type: stringThe 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.
No Additional Items
Each item of this array must be:
Requested properties for the snapshot.
ZFSResourceSnapshotPropertiesEntry
Type: objectNo Additional Properties
Type
Type: object(READ-ONLY): Type of ZFS dataset (filesystem, volume, etc).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
SourceValue
Type: objectNo Additional Properties
Type
Type: enum (of string)The source type.
Must be one of:
- "NONE"
- "DEFAULT"
- "TEMPORARY"
- "LOCAL"
- "INHERITED"
- "RECEIVED"
Value
The source value.
Value
The parsed raw value of the property.
Creation
Type: object(READ-ONLY): Timestamp when dataset was created.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Used
Type: object(READ-ONLY): Space used by dataset and descendants.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Referenced
Type: object(READ-ONLY): Space referenced by this dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Compressratio
Type: object(READ-ONLY): Property showing achieved compression ratio.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Createtxg
Type: object(READ-ONLY): Transaction group when dataset was created.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Guid
Type: object(READ-ONLY): Globally unique identifier for the dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Primarycache
Type: objectControls primary cache usage (all, metadata, or none).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Secondarycache
Type: objectControls secondary cache usage (all, metadata, or none).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Objsetid
Type: object(READ-ONLY): Object set identifier for the dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Mlslabel
Type: objectMulti-level security label for the dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Refcompressratio
Type: object(READ-ONLY): Compression ratio for referenced data.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Written
Type: object(READ-ONLY): Space referenced since previous snapshot.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Logicalreferenced
Type: object(READ-ONLY): Logical space referenced by dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Context
Type: objectSELinux security context for the dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Fscontext
Type: objectSELinux filesystem security context.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defcontext
Type: objectSELinux default security context for new files.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Rootcontext
Type: objectSELinux root directory security context.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Encryption
Type: objectControls encryption cipher suite for the dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Encryptionroot
Type: object(READ-ONLY): Property showing encryption root dataset.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Keystatus
Type: object(READ-ONLY): Encryption key status (available/unavailable).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Redact Snaps
Type: object(READ-ONLY): List of redaction snapshots.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Prefetch
Type: objectControls prefetch behavior (all, metadata, or none).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Devices
Type: objectControls whether device files can be opened.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Exec
Type: objectControls whether programs can be executed from filesystem.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Setuid
Type: objectControls setuid/setgid bit respect on executable files.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Xattr
Type: objectControls extended attribute behavior (on, off, sa, dir).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Version
Type: object(READ-ONLY): Filesystem version number.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Utf8Only
Type: objectControls whether only UTF-8 filenames are allowed.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Normalization
Type: objectUnicode normalization property for filenames.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Casesensitivity
Type: objectDetermines filename matching algorithm sensitivity.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Nbmand
Type: objectControls non-blocking mandatory locking behavior.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Acltype
Type: objectSpecifies type of ACL to use (off, nfsv4, posix).
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defaultuserquota
Type: objectDefault space quota for new users.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defaultgroupquota
Type: objectDefault space quota for new groups.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defaultprojectquota
Type: objectDefault space quota for new projects.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defaultuserobjquota
Type: objectDefault object quota for new users.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defaultgroupobjquota
Type: objectDefault object quota for new groups.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Defaultprojectobjquota
Type: objectDefault object quota for new projects.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
Volsize
Type: objectLogical size of the volume.
No Additional PropertiesRaw
Type: stringThe raw value of the property.
The source from where this property received its value.
Value
The parsed raw value of the property.
User Properties
User-defined properties for snapshots.
Each additional property must conform to the following schema
Type: stringRequired roles: SNAPSHOT_READ