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

Start a file copy operation

Contributors

POST /storage/file/copy

Starts a file copy operation.

Required properties

  • files_to_copy - List of files with the destination they are to be copied to.

Default property values

  • cutover_time - 10

  • hold_quiescence - false

  • max_throughput - 0

  • reference_cutover_time - 10

  • volume file copy start

Examples

Copying two files

The POST request is used to copy file(s).

# The API:
/api/storage/file/copy

# The call:
curl -X POST  "https://<mgmt-ip>/api/storage/file/copy" -H "accept: application/hal+json" -d '{"files_to_copy":[{"source":{"volume":{"name":"vol_a"},"svm":{"name":"vs0"},"path":"d1/src_f1"},"destination":{"volume":{"name":"vol_a"},"svm":{"name":"vs0"},"path":"d1/dst_f1"}}, {"source":{"volume":{"name":"vol_a"},"svm":{"name":"vs0"},"path":"d1/src_f2"},"destination":{"volume":{"name":"vol_a"},"svm":{"name":"vs0"},"path":"d1/dst_f2"}}]}'

# The response:
{
"job": {
  "uuid": "b89bc5dd-94a3-11e8-a7a3-0050568edf84",
  "_links": {
     "self": {
       "href": "/api/cluster/jobs/b89bc5dd-94a3-11e8-a7a3-0050568edf84"
     }
   }
 }
}

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.

return_records

boolean

query

False

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

Request Body

Name Type Description

cutover_time

integer

The maximum amount of time (in seconds) that the source can be quiesced before a destination file must be made available for read-write traffic.

files_to_copy

array[files_to_copy]

A list of source files along with the destinations they are copied to. If the terminal path component of the destination is a directory, then the source file's basename is replicated in that directory.

hold_quiescence

boolean

Specifies whether the source file should be held quiescent for the duration of the copy operation.

max_throughput

integer

The maximum amount of data (in bytes) that can be transferred per second in support of this operation.

reference_cutover_time

integer

The maximum amount of time (in seconds) that the source reference file can be quiesced before the corresponding destination file must be made available for read-write traffic.

reference_file

reference_file

Example request
{
  "cutover_time": 10,
  "files_to_copy": [
    {
      "destination": {
        "path": "string",
        "svm": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "name": "svm1",
          "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
        },
        "volume": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "name": "volume1",
          "uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
        }
      },
      "source": {
        "path": "string",
        "svm": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "name": "svm1",
          "uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
        },
        "volume": {
          "_links": {
            "self": {
              "href": "/api/resourcelink"
            }
          },
          "name": "volume1",
          "uuid": "028baa66-41bd-11e9-81d5-00a0986138f7"
        }
      }
    }
  ],
  "reference_cutover_time": 10,
  "reference_file": {
    "path": "string",
    "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

ONTAP Error Response Codes

Error Code Description

7012352

File locations are inconsistent. All files must be on the same volume.

7012353

Exceeded the file operations supported number of files.

7012354

Unable to pair the number of source files to destination files.

7012357

Cannot start a file operation until all cluster nodes support the file operations capability.

7012358

The specified source path is invalid.

7012359

The specified destination path is invalid.

7012360

The SVMs are not in an intracluster peering relationship.

7012361

The SVMs peering relationship does not include application "file-copy".

7012362

The SVMs are not yet in a peered state yet.

7012363

Cannot copy files. All file operations must be managed by the destination SVM's administrator.

7012365

Copying a file between clusters is not supported.

7012367

A reference path may only be specified if multiple source paths are specified.

7012368

The reference path must have a matching source path.

7012371

The reference cutover time exceeds the maximum allowable time.

7012374

Source volume and destination volume have different home clusters.

7012376

Operation not allowed on a volume that is part of a SnapMirror Synchronous relationship.

7012377

Cannot start a file copy operation on the volume because an active volume conversion is in progress.

196608143

Cannot start operation. The volume is undergoing a secure purge operation.

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

svm

Name Type Description

_links

_links

name

string

The name of the SVM.

uuid

string

The unique identifier of the SVM.

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

file_reference

Name Type Description

path

string

Path of the file or directory.

svm

svm

volume

volume

files_to_copy

Name Type Description

destination

file_reference

source

file_reference

reference_file

Name Type Description

path

string

The source reference file. If a reference file is specified, data for other files being copied will be transferred as a difference from the reference file. This can save bandwidth and destination storage if the specified source files share blocks. If provided, this input must match one of the source file paths. This input need not be provided if only one source file is specified.

volume

volume

file_copy

File copy

Name Type Description

cutover_time

integer

The maximum amount of time (in seconds) that the source can be quiesced before a destination file must be made available for read-write traffic.

files_to_copy

array[files_to_copy]

A list of source files along with the destinations they are copied to. If the terminal path component of the destination is a directory, then the source file's basename is replicated in that directory.

hold_quiescence

boolean

Specifies whether the source file should be held quiescent for the duration of the copy operation.

max_throughput

integer

The maximum amount of data (in bytes) that can be transferred per second in support of this operation.

reference_cutover_time

integer

The maximum amount of time (in seconds) that the source reference file can be quiesced before the corresponding destination file must be made available for read-write traffic.

reference_file

reference_file

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.