Skip to main content
A newer release of this product is available.

Create a clone of the file

Contributors

POST /storage/file/clone

Introduced In: 9.6

Creates a clone of the file.

Parameters

Name Type In Required Description

return_timeout

integer

query

False

The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202.

  • Default value: 1

  • Max value: 120

  • Min value: 0

return_records

boolean

query

False

The default is false. If set to true, the records are returned.

  • Default value:

Request Body

Name Type Description

autodelete

boolean

Mark clone file for auto deletion.

destination_path

string

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

is_backup

boolean

Mark clone file for backup.

overwrite_destination

boolean

Destination file gets overwritten.

range

array[string]

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

source_path

string

Relative path of the source file in the volume.

volume

volume

Example request
{
  "destination_path": "dest_file1, dir1/dest_file2",
  "range": [
    "10:10:5",
    "20:20:10"
  ],
  "source_path": "src_file1, dir1/src_file2, ./.snapshot/snap1/src_file3",
  "volume": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "name": "volume1",
    "uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
  }
}

Response

Status: 202, Accepted
Name Type Description

job

job_link

Example response
{
  "job": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "uuid": "string"
  }
}

Error

Status: Default, Error
Name Type Description

error

error

Example error
{
  "error": {
    "arguments": [
      {
        "code": "string",
        "message": "string"
      }
    ],
    "code": "4",
    "message": "entry doesn't exist",
    "target": "uuid"
  }
}

Definitions

See Definitions

href

Name Type Description

href

string

Name Type Description

self

href

volume

Name Type Description

_links

_links

name

string

The name of the volume.

uuid

string

Unique identifier for the volume. This corresponds to the instance-uuid that is exposed in the CLI and ONTAPI. It does not change due to a volume move.

  • example: 028baa66-41bd-11e9-81d5-00a0986138f7

  • Introduced in: 9.6

file_clone

File clone

Name Type Description

autodelete

boolean

Mark clone file for auto deletion.

destination_path

string

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

is_backup

boolean

Mark clone file for backup.

overwrite_destination

boolean

Destination file gets overwritten.

range

array[string]

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

source_path

string

Relative path of the source file in the volume.

volume

volume

Name Type Description

_links

_links

uuid

string

The UUID of the asynchronous job that is triggered by a POST, PATCH, or DELETE operation.

error_arguments

Name Type Description

code

string

Argument code

message

string

Message argument

error

Name Type Description

arguments

array[error_arguments]

Message arguments

code

string

Error code

message

string

Error message

target

string

The target parameter that caused the error.