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

Destroy a ZFS resource (filesystem or volume).

This method provides an interface for destroying ZFS datasets and volumes         with support for recursive deletion.

NOTE: To destroy snapshots, use `zfs.resource.snapshot.destroy`.

Args: data (dict): Dictionary containing destruction parameters: - path (str): Path of the ZFS resource to destroy. Must be in the form                     'pool/name' or 'pool/zvol'. Snapshot paths (containing '@') are                     not accepted - use `zfs.resource.snapshot.destroy` instead. Cannot be an absolute path or end with a forward slash. - recursive (bool, optional): If True, recursively destroy all descendants                     including their snapshots, clones, and holds. Default: False.

Returns: None: On successful destruction.

Raises: ValidationError: Raised in the following cases: - Snapshot path provided (use zfs.resource.snapshot.destroy) - Resource does not exist (ENOENT) - Resource has children and recursive=False (EBUSY) - Resource has snapshots and recursive=False - Attempting to destroy root filesystem - Path is absolute (starts with /) - Path ends with forward slash - Path references protected internal resources

Examples: # Destroy a simple filesystem destroy({"path": "tank/temp"})

    # Recursively destroy filesystem and all descendants destroy({"path": "tank/parent", "recursive": True})

Notes: - Root filesystem destruction is not allowed for safety - Protected system paths cannot be destroyed via API - Datasets with snapshots require recursive=True - To destroy snapshots, use `zfs.resource.snapshot.destroy`

.. 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>Parameters.</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 of the zfs resource (dataset or volume) to be destroyed.     Snapshot paths (containing '@') are not accepted - use     <code>zfs.resource.snapshot.destroy</code> instead.</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 all descendants of the resource, including     child datasets, snapshots, clones, and holds.</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:* ZFS_RESOURCE_WRITE

