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})

.. raw:: html

    <div id="json-schema">
    <span class="badge badge-dark value-type">Type: object</span><br/>
    <div class="accordion" id="accordionCall_parameters">
    <div class="card">
    <div class="card-header" id="headingCall_parameters">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters" data-toggle="collapse" onclick="setAnchor('#Call_parameters')" type="button"><span class="property-name">Call parameters</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters" class="collapse property-definition-div" data-parent="#accordionCall_parameters" id="Call_parameters">
    <div class="card-body pl-5">
    <span class="badge badge-dark value-type">Type: array</span><br/>
    <span class="badge badge-info no-additional">No Additional Items</span><h4>Tuple Validation</h4>
    <h5>Parameter 1: data</h5>
    <div class="card">
    <div class="card-body items-definition" id="Call_parameters_items_i0">
    <h4>data</h4><span class="badge badge-dark value-type">Type: object</span> <span class="badge badge-success default-value">Default: {"paths": [], "recursive": false}</span><br/>
    <span class="description"><p>Count parameters for counting ZFS snapshots.</p>
    </span> <span class="badge badge-info no-additional">No Additional Properties</span>
    <div class="accordion" id="accordionCall_parameters_items_i0_paths">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_paths">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_paths" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_paths" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_paths')" type="button"><span class="property-name">paths</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_paths" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_paths" id="Call_parameters_items_i0_paths">
    <div class="card-body pl-5">
    <h4>Paths</h4><span class="badge badge-dark value-type">Type: array of string</span> <span class="badge badge-success default-value">Default: []</span><br/>
    <span class="description"><p>Dataset paths to count snapshots for. If empty, counts all snapshots.</p>
    </span>
    <p><span class="badge badge-light restriction unique-items-restriction" id="Call_parameters_items_i0_paths_uniqueItems">All items must be unique</span></p> <span class="badge badge-info no-additional">No Additional Items</span><h5>Each item of this array must be:</h5>
    <div class="card">
    <div class="card-body items-definition" id="Call_parameters_items_i0_paths_items">
    <span class="badge badge-dark value-type">Type: string</span><br/>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionCall_parameters_items_i0_recursive">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_recursive">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_recursive" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_recursive" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_recursive')" type="button"><span class="property-name">recursive</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_recursive" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_recursive" id="Call_parameters_items_i0_recursive">
    <div class="card-body pl-5">
    <h4>Recursive</h4><span class="badge badge-dark value-type">Type: boolean</span> <span class="badge badge-success default-value">Default: false</span><br/>
    <span class="description"><p>Include snapshots from child datasets when counting.</p>
    </span>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionReturn_value">
    <div class="card">
    <div class="card-header" id="headingReturn_value">
    <h2 class="mb-0">
    <button aria-controls="Return_value" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value" data-toggle="collapse" onclick="setAnchor('#Return_value')" type="button"><span class="property-name">Return value</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingReturn_value" class="collapse property-definition-div" data-parent="#accordionReturn_value" id="Return_value">
    <div class="card-body pl-5">
    <h4>Result</h4><span class="badge badge-dark value-type">Type: object</span><br/>
    <span class="description"><p>Mapping of dataset names to their snapshot counts.</p>
    </span>
    <div class="accordion" id="accordionReturn_value_additionalProperties">
    <div class="card">
    <div class="card-header" id="headingReturn_value_additionalProperties">
    <h2 class="mb-0">
    <button aria-controls="Return_value_additionalProperties" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_additionalProperties" data-toggle="collapse" onclick="setAnchor('#Return_value_additionalProperties')" type="button"><em><span class="property-name">Additional Properties</span></em></button>
    </h2>
    </div>
    <div aria-labelledby="headingReturn_value_additionalProperties" class="collapse property-definition-div" data-parent="#accordionReturn_value_additionalProperties" id="Return_value_additionalProperties">
    <div class="card-body pl-5"><p class="additional-properties">Each additional property must conform to the following schema</p>
    <span class="badge badge-dark value-type">Type: integer</span><br/>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div><br><br>

*Required roles:* SNAPSHOT_READ

