zfs.resource.snapshot.destroy
=============================

Destroy ZFS snapshots.

Args: data: Destroy parameters containing: - path: Snapshot path (e.g., 'pool/dataset@snapshot') or dataset path when all_snapshots=True (e.g., 'pool/dataset'). - recursive: Recursively destroy matching snapshots in child datasets. - all_snapshots: If True, path is a dataset and all its snapshots are destroyed. - defer: Defer destruction if snapshot is in use (e.g., has clones).

Returns: None on success.

Raises: ValidationError: If snapshot not found, has clones (without defer), or has holds.

Examples: # Destroy a single snapshot destroy({"path": "tank/data@backup"})

    # Destroy recursively (all matching child snapshots) destroy({"path": "tank@backup", "recursive": True})

    # Defer destruction if in use destroy({"path": "tank/data@snap", "defer": True})

    # Destroy all snapshots for a dataset destroy({"path": "tank/data", "all_snapshots": True})

    # Destroy all snapshots for a dataset and its children destroy({"path": "tank", "all_snapshots": True, "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><br/>
    <span class="description"><p>Destroy parameters for removing ZFS snapshots.</p>
    </span> <span class="badge badge-info no-additional">No Additional Properties</span>
    <div class="accordion" id="accordionCall_parameters_items_i0_path">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_path">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_path" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_path" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_path')" type="button"><span class="property-name">path</span> <span class="badge badge-warning required-property">Required</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_path" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_path" id="Call_parameters_items_i0_path">
    <div class="card-body pl-5">
    <h4>Path</h4><span class="badge badge-dark value-type">Type: string</span><br/>
    <span class="description"><p>Path to destroy. Either a snapshot path (e.g., 'pool/dataset@snapshot') or     a dataset path when all_snapshots=True (e.g., 'pool/dataset').</p>
    </span>
    <p><span class="badge badge-light restriction min-length-restriction" id="Call_parameters_items_i0_path_minLength">Must be at least <code>1</code> characters long</span></p>
    </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>Recursively destroy matching snapshots in child datasets.</p>
    </span>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionCall_parameters_items_i0_all_snapshots">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_all_snapshots">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_all_snapshots" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_all_snapshots" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_all_snapshots')" type="button"><span class="property-name">all_snapshots</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_all_snapshots" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_all_snapshots" id="Call_parameters_items_i0_all_snapshots">
    <div class="card-body pl-5">
    <h4>All Snapshots</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>If True, path should be a dataset path and all its snapshots will be destroyed.</p>
    </span>
    </div>
    </div>
    </div>
    </div>
    <div class="accordion" id="accordionCall_parameters_items_i0_defer">
    <div class="card">
    <div class="card-header" id="headingCall_parameters_items_i0_defer">
    <h2 class="mb-0">
    <button aria-controls="Call_parameters_items_i0_defer" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_defer" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_defer')" type="button"><span class="property-name">defer</span></button>
    </h2>
    </div>
    <div aria-labelledby="headingCall_parameters_items_i0_defer" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_defer" id="Call_parameters_items_i0_defer">
    <div class="card-body pl-5">
    <h4>Defer</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>Defer destruction if snapshot is in use (e.g., has clones).</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: null</span><br/>
    </div>
    </div>
    </div>
    </div>
    </div><br><br>

*Required roles:* SNAPSHOT_DELETE

