netapp_ontap.resources.file_clone API documentation
Description: Copyright &copy; 2026 NetApp Inc. All rights reserved …

# Module `netapp_ontap.resources.file_clone`

Copyright © 2026 NetApp Inc. All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

## Overview

You can use these API's to create file clones, retrieve split status and manage split loads. These endpoints are used for cloning files within a volume, without taking much of extra space. Child and parent clones shares the unchanged blocks of data. REST support for sis clone creation for Flex Group volumes is blocked.
A file clone split operation detach child clone from its parent. Split operations use space. To ensure that file clone create operation is not affected by split, file clone tokens are use to reserve space. API endpoints can be used to update the validity and space reserved by token.

## File clone APIs

The following APIs are used to perform the following operations:

- POST /api/storage/file/clone
- GET /api/storage/file/clone/split-status
- PATCH /api/storage/file/clone/split-loads/{node.uuid}
- GET /api/storage/file/clone/split-loads/{node.uuid}
- GET /api/storage/file/clone/split-loads
- GET /api/storage/file/clone/tokens/
- DELETE /api/storage/file/clone/tokens/{node.uuid}/{token.uuid}
- PATCH /api/storage/file/clone/tokens/{node.uuid}/{token.uuid}

## Classes

`class FileClone (*args, **kwargs)`

  File clone

  Initialize the instance of the resource.

  Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:

      MyResource(name='foo').name == 'foo'

  ## Args

  `*args`
    Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
  `**kwargs`
    each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.

  ### Ancestors

  - Resource

  ### Static methods

  `def post_collection (records: Iterable[ForwardRef('FileClone')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[FileClone], NetAppResponse]`

    Creates a clone of the file.

    ### Required Properties

    - `source_path`
    - `destination_path`
    - `volume.uuid` - Instance UUID of the volume in which to create clone.

    ### Optional Properties

    - `range` - Required only in the case of a sub file clone.
    - `autodelete` - Marks a cloned file for auto deletion.
    - `is_backup` - Cloned file is used as a backup.
    - `volume.name` - Name of the volume in which to create the clone.
    - `token_uuid` - UUID of existing clone token.

    ### Related Ontap commands

    - `volume file clone create`

    ### Creating file clones

    The POST operation is used to create file clones with the specified attributes in the body. Set the `volume.uuid` to identify the volume. Set `source_path` and `destination_path` to identify the file path of the original and copied file. For a full file clone, the new file is created using `destination_path`. For a sub file clone, set `range` in the format source-file-block-number:destination-file-block-number:block-count. The API returns an error for the following overlapping conditions: (a) if the source and destination files are the same and if any of the source ranges overlap with any of the destination ranges. (b) if any of the source ranges overlap amongst themselves. (c) if any of the destination ranges overlap amongst themselves. If not provided, full file cloning is assumed.
    If set to `autodelete`, the cloned file is deleted when the volumes are full.<br>

        # The API:
        curl -X POST "https://<mgmt_ip>/api/storage/file/clone" -H "accept: application/hal+json" -d '{"volume": {"name": "vol1",  "uuid": "40e0fdc5-c28f-11eb-8270-005056bbeb0b"}, "source_path": "f1", "destination_path": "f2_c1"}'
        # The response:
        {
          "job": {
            "uuid": "0d025fd9-c4dc-11eb-adb5-005056bbeb0b",
            "_links": {
               "self": {
                 "href": "/api/cluster/jobs/0d025fd9-c4dc-11eb-adb5-005056bbeb0b"
               }
            }
          }
        }

    ### Learn More

    - [`DOC /storage/file/clone`]

    ### Learn more

    - `DOC /storage/file/clone`

    Send this collection of objects to the host as a creation request.

    ## Args

    `records`
      A list of `Resource` objects to send to the server to be created.
    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to create a bar for a particular foo, the foo.name value should be passed.
    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of each object. When hydrate is set to True, poll must also be set to True.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

    ## Returns

    A list of `Resource` objects matching the provided type which have been created by the host and returned. This is not the same list that was provided, so to continue using the object, you should save this list. If poll is set to False, then a `NetAppResponse` object is returned instead.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Methods

  `def post (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Creates a clone of the file.

    ### Required Properties

    - `source_path`
    - `destination_path`
    - `volume.uuid` - Instance UUID of the volume in which to create clone.

    ### Optional Properties

    - `range` - Required only in the case of a sub file clone.
    - `autodelete` - Marks a cloned file for auto deletion.
    - `is_backup` - Cloned file is used as a backup.
    - `volume.name` - Name of the volume in which to create the clone.
    - `token_uuid` - UUID of existing clone token.

    ### Related Ontap commands

    - `volume file clone create`

    ### Creating file clones

    The POST operation is used to create file clones with the specified attributes in the body. Set the `volume.uuid` to identify the volume. Set `source_path` and `destination_path` to identify the file path of the original and copied file. For a full file clone, the new file is created using `destination_path`. For a sub file clone, set `range` in the format source-file-block-number:destination-file-block-number:block-count. The API returns an error for the following overlapping conditions: (a) if the source and destination files are the same and if any of the source ranges overlap with any of the destination ranges. (b) if any of the source ranges overlap amongst themselves. (c) if any of the destination ranges overlap amongst themselves. If not provided, full file cloning is assumed.
    If set to `autodelete`, the cloned file is deleted when the volumes are full.<br>

        # The API:
        curl -X POST "https://<mgmt_ip>/api/storage/file/clone" -H "accept: application/hal+json" -d '{"volume": {"name": "vol1",  "uuid": "40e0fdc5-c28f-11eb-8270-005056bbeb0b"}, "source_path": "f1", "destination_path": "f2_c1"}'
        # The response:
        {
          "job": {
            "uuid": "0d025fd9-c4dc-11eb-adb5-005056bbeb0b",
            "_links": {
               "self": {
                 "href": "/api/cluster/jobs/0d025fd9-c4dc-11eb-adb5-005056bbeb0b"
               }
            }
          }
        }

    ### Learn More

    - [`DOC /storage/file/clone`]

    ### Learn more

    - `DOC /storage/file/clone`

    Send this object to the host as a creation request.

    ## Args

    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Inherited members

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
    - `validate_schema`
`class FileCloneSchema (*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)`

  The fields of the FileClone object

  ### Ancestors

  - netapp_ontap.resource.ResourceSchema
  - marshmallow.schema.Schema
  - marshmallow.base.SchemaABC
  - abc.ABC

  ### Class variables

  `autodelete: bool GET POST PATCH`

    Mark clone file for auto deletion.

  `destination_path: str GET POST PATCH`

    Relative path of the clone/destination file in the volume.

    Example: dest_file1 or dir1/dest_file2

  `is_backup: bool GET POST PATCH`

    Mark clone file for backup.

    Example: false

  `overwrite_destination: bool GET POST PATCH`

    Destination file gets overwritten.

  `range: List[str] GET POST PATCH`

    List of block ranges for sub-file cloning in the format "source-file-block-number:destination-file-block-number:block-count"

    Example: ["0:0:2"]

  `source_path: str GET POST PATCH`

    Relative path of the source file in the volume.

    Example: src_file1 or dir1/src_file2 or ./.snapshot/snap1/src_file3

  `token_uuid: str GET POST PATCH`

    UUID of existing clone token with reserved split load.

  `volume: Volume GET POST PATCH`

    The volume field of the file_clone.