Module netapp_ontap.resources.file_move
Copyright © 2020 NetApp Inc. All rights reserved.
Classes
class FileMove (*args, **kwargs)
-
File move
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
Methods
def post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Starts a file move operation. Only supported on flexible volumes.
Required properties
files_to_move
- List of files with the destination they are to be moved to.
Default property values
cutover_time
- 10hold_quiescence
- falsemax_throughput
- 0reference_cutover_time
- 10
Related ONTAP commands
volume file move start
Examples
Copying two files
The POST request is used to move file(s).
# The API: /api/storage/file/move # The call: curl -X POST "https://<mgmt-ip>/api/storage/file/move" -H "accept: application/hal+json" -d '{"files_to_move":[{"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" } } } }
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.
**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
netapp_ontap.response.NetAppResponse
object containing the details of the HTTP response.Raises
netapp_ontap.error.NetAppRestError
: If the API call returned a status code >= 400
Inherited members
class FileMoveSchema (*, only: typing.Union = None, exclude: typing.Union = (), many: bool = False, context: typing.Dict = None, load_only: typing.Union = (), dump_only: typing.Union = (), partial: typing.Union = False, unknown: str = None)
-
The fields of the FileMove object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.base.SchemaABC
Class variables
-
cutover_time GET POST PATCH
-
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.
Example: 10
-
files_to_move GET POST PATCH
-
A list of source files along with the destination file they are moved to. If the terminal path component of the destination is a directory, then the source file's basename is replicated in that directory.
-
max_throughput GET POST PATCH
-
The maximum amount of data (in bytes) that can be transferred per second in support of this operation.
-
reference_cutover_time GET POST PATCH
-
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.
Example: 10
-
reference_file GET POST PATCH
-
The reference_file field of the file_move.