Module netapp_ontap.resources.file_move

Copyright © 2023 NetApp Inc. All rights reserved.

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

Overview

You can use this API to start a file move operation between two FlexVol volumes or within a FlexGroup volume, and view the status of all on-going file move operations in the cluster.

  • GET /api/storage/file/moves
  • GET /api/storage/file/moves/{node.uuid}/{uuid}/{index}
  • POST /api/storage/file/moves

Examples

Moving two files from one FlexVol volume to the other FlexVol volume

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove()
    resource.files_to_move = {
        "sources": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f1.txt"},
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f2.txt"},
        ],
        "destinations": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fv2"}, "path": "dir2/f1.txt"},
            {"svm": {"name": "vs0"}, "volume": {"name": "fv2"}, "path": "dir2/f2.txt"},
        ],
    }
    resource.post(hydrate=True)
    print(resource)

Moving two files from one FlexVol volume to the other FlexVol volume (only specifying the destination directory)

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove()
    resource.files_to_move = {
        "sources": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f3.txt"},
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f4.txt"},
        ],
        "destinations": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fv2"}, "path": "dir2/"}
        ],
    }
    resource.post(hydrate=True)
    print(resource)

Moving multiple files from one FlexVol volume to the other FlexVol volume and providing a source reference file

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove()
    resource.files_to_move = {
        "sources": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f5.txt"},
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f6.txt"},
            {"svm": {"name": "vs0"}, "volume": {"name": "fv1"}, "path": "dir1/f7.txt"},
        ],
        "destinations": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fv2"}, "path": "dir2/f5.txt"},
            {"svm": {"name": "vs0"}, "volume": {"name": "fv2"}, "path": "dir2/f6.txt"},
            {
                "svm": {"name": "vs0"},
                "volume": {"name": "fv2"},
                "path": "dir2/f700.txt",
            },
        ],
    }
    resource.reference = {
        "svm": {"name": "vs0"},
        "volume": {"name": "fv1"},
        "path": "dir1/f6.txt",
    }
    resource.post(hydrate=True)
    print(resource)

Moving a file between two FlexGroup volume constituents in the same FlexGroup volume

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove()
    resource.files_to_move = {
        "sources": [
            {"svm": {"name": "vs0"}, "volume": {"name": "fg2"}, "path": "test/file.txt"}
        ],
        "destinations": [{"volume": {"name": "fg2__0008"}}],
    }
    resource.post(hydrate=True)
    print(resource)

Automatically selecting a destination constituent to move a file in a FlexGroup volume for capacity rebalancing

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove()
    resource.files_to_move = {
        "sources": [
            {
                "svm": {"name": "vs0"},
                "volume": {"name": "fg2"},
                "path": "test/file2.txt",
            }
        ]
    }
    resource.post(hydrate=True, automatic=True)
    print(resource)

Moving a file between two FlexGroup volume constituents in the same FlexGroup volume using the "force" and "disruptive" options

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove()
    resource.files_to_move = {
        "sources": [
            {
                "svm": {"name": "vs0"},
                "volume": {"name": "fg2"},
                "path": "test/file3.txt",
            }
        ],
        "destinations": [{"volume": {"name": "fg2__0008"}}],
    }
    resource.post(hydrate=True, force=True, disruptive=True)
    print(resource)

Retrieving file move operations

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    print(list(FileMove.get_collection()))

[
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fg2__0005",
                    "uuid": "4d14f2f6-1c76-11ec-8e1b-005056acf2dd",
                },
                "path": "test/file2.txt",
            },
            "uuid": "e12bc78d-36bb-4274-8163-fb8c21d59c9b",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fg2__0008",
                    "uuid": "4e919b6d-1c76-11ec-8e1b-005056acf2dd",
                },
                "path": "test/file2.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f2.txt",
            },
            "uuid": "ce2af347-586d-4b31-b728-1e925f51fdfc",
            "index": 1,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f2.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f1.txt",
            },
            "uuid": "ce2af347-586d-4b31-b728-1e925f51fdfc",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f1.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f3.txt",
            },
            "uuid": "6d12601b-5377-43bf-99f0-b4bec37565e2",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f3.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f4.txt",
            },
            "uuid": "6d12601b-5377-43bf-99f0-b4bec37565e2",
            "index": 1,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f4.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f5.txt",
            },
            "uuid": "bbfdface-0d46-4f5f-9624-72f4869eba81",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f5.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f700.txt",
            },
            "uuid": "bbfdface-0d46-4f5f-9624-72f4869eba81",
            "index": 2,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f7.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f6.txt",
            },
            "uuid": "bbfdface-0d46-4f5f-9624-72f4869eba81",
            "index": 1,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f6.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/780255d2-10aa-11ec-a308-005056acf86d"
                    }
                },
                "name": "node2",
                "uuid": "780255d2-10aa-11ec-a308-005056acf86d",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fg2__0008",
                    "uuid": "4e919b6d-1c76-11ec-8e1b-005056acf2dd",
                },
                "path": "/test/file.txt",
            },
            "uuid": "6591a42a-4ea2-4d40-bfb4-38959f6bd68e",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fg2__0001",
                    "uuid": "438731dd-1c76-11ec-8e1b-005056acf2dd",
                },
                "path": "test/file.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/780255d2-10aa-11ec-a308-005056acf86d"
                    }
                },
                "name": "node2",
                "uuid": "780255d2-10aa-11ec-a308-005056acf86d",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fg2__0008",
                    "uuid": "4e919b6d-1c76-11ec-8e1b-005056acf2dd",
                },
                "path": "/test/file3.txt",
            },
            "uuid": "1a94e95a-346e-4eb3-969a-110e275cbf18",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fg2__0001",
                    "uuid": "438731dd-1c76-11ec-8e1b-005056acf2dd",
                },
                "path": "test/file3.txt",
            },
        }
    ),
]

Retrieving all moves in a file move operation

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove(
        index="*", uuid="ce2af347-586d-4b31-b728-1e925f51fdfc", **{"node.uuid": "*"}
    )
    resource.get()
    print(resource)

[
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f2.txt",
            },
            "uuid": "ce2af347-586d-4b31-b728-1e925f51fdfc",
            "index": 1,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f2.txt",
            },
        }
    ),
    FileMove(
        {
            "node": {
                "_links": {
                    "self": {
                        "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                    }
                },
                "name": "node1",
                "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
            },
            "destination": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv2",
                    "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir2/f1.txt",
            },
            "uuid": "ce2af347-586d-4b31-b728-1e925f51fdfc",
            "index": 0,
            "source": {
                "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
                "volume": {
                    "name": "fv1",
                    "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd",
                },
                "path": "dir1/f1.txt",
            },
        }
    ),
]

Retrieving a specific file move in a file move operation

from netapp_ontap import HostConnection
from netapp_ontap.resources import FileMove

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = FileMove(
        index=1, uuid="ce2af347-586d-4b31-b728-1e925f51fdfc", **{"node.uuid": "*"}
    )
    resource.get()
    print(resource)

FileMove(
    {
        "node": {
            "_links": {
                "self": {
                    "href": "/api/cluster/nodes/76bc12d1-10aa-11ec-a5b5-005056acf2dd"
                }
            },
            "name": "node1",
            "uuid": "76bc12d1-10aa-11ec-a5b5-005056acf2dd",
        },
        "destination": {
            "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
            "volume": {"name": "fv2", "uuid": "220bdb3a-26f1-11ec-bf0d-005056acf2dd"},
            "path": "dir2/f2.txt",
        },
        "uuid": "ce2af347-586d-4b31-b728-1e925f51fdfc",
        "index": 1,
        "source": {
            "svm": {"name": "vs0", "uuid": "5b2c8638-10bc-11ec-8e1b-005056acf2dd"},
            "volume": {"name": "fv1", "uuid": "18fd9110-26f1-11ec-bf0d-005056acf2dd"},
            "path": "dir1/f2.txt",
        },
    }
)

Classes

class FileMove (*args, **kwargs)

Details of a file move operation.

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

Static methods

def count_collection (*args, connection: HostConnection = None, **kwargs) -> int

Returns a count of all FileMove resources that match the provided query


This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.

Args

*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 get the count of bars for a particular foo, the foo.name value should be passed.
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. These query parameters can affect the count. A return_records query param will be ignored.

Returns

On success, returns an integer count of the objects of this type. On failure, returns -1.

Raises

NetAppRestError: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library.

def find (*args, connection: HostConnection = None, **kwargs) -> Resource

Retrieves all ongoing file move operations in the cluster.

  • volume file move show
  • volume rebalance file-move show

Learn more


Find an instance of an object on the host given a query.

The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found, None will be returned. If more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.

Args

*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 find a bar for a particular foo, the foo.name value should be passed.
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.

Returns

A Resource object containing the details of the object or None if no matches were found.

Raises

NetAppRestError: If the API call returned more than 1 matching resource.

def get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[Resource]

Retrieves all ongoing file move operations in the cluster.

  • volume file move show
  • volume rebalance file-move show

Learn more


Fetch a list of all objects of this type from the host.

This is a lazy fetch, making API calls only as necessary when the result of this call is iterated over. For instance, if max_records is set to 5, then iterating over the collection causes an API call to be sent to the server once for every 5 records. If the client stops iterating before getting to the 6th record, then no additional API calls are made.

Args

*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 get the collection of bars for a particular foo, the foo.name value should be passed.
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.
max_records
The maximum number of records to return per call
**kwargs
Any key/value pairs passed will be sent as query parameters to the host.

Returns

A list of Resource objects

Raises

NetAppRestError: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

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

Starts a file move operation. This API can be used to move files from one FlexVol volume to another FlexVol volume or within a FlexGroup volume for capacity rebalancing. For a FlexGroup volume file move operation, only one source file can be specified in files_to_move. The source volume is the FlexGroup volume. The destination volume is the destination FlexGroup volume constituent to move the file to. When automatic is true, destination volume is not required. The source path is the path to the file to be moved within the FlexGroup volume. If the destination path is specified, it must be the same as the source path.

Required properties for file move operation

  • files_to_move - List of files with the destination they are to be moved to.

Optional properties for file move operation

  • reference - The source reference file for moving multiple files.

Default property values

  • max_throughput - 0
  • max_cutover_time - 10
  • reference.max_cutover_time - 10
  • volume file move start
  • volume rebalance file-move start

Learn more


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 get (self, **kwargs) -> NetAppResponse

Overview

Retrieve the status of an on-going file move operation.

  • volume file move show
  • volume rebalance file-move show

Learn more


Fetch the details of the object from the host.

Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

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

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

Starts a file move operation. This API can be used to move files from one FlexVol volume to another FlexVol volume or within a FlexGroup volume for capacity rebalancing. For a FlexGroup volume file move operation, only one source file can be specified in files_to_move. The source volume is the FlexGroup volume. The destination volume is the destination FlexGroup volume constituent to move the file to. When automatic is true, destination volume is not required. The source path is the path to the file to be moved within the FlexGroup volume. If the destination path is specified, it must be the same as the source path.

Required properties for file move operation

  • files_to_move - List of files with the destination they are to be moved to.

Optional properties for file move operation

  • reference - The source reference file for moving multiple files.

Default property values

  • max_throughput - 0
  • max_cutover_time - 10
  • reference.max_cutover_time - 10
  • volume file move start
  • volume rebalance file-move start

Learn more


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 NetAppResponse object containing the details of the HTTP response.

Raises

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

Inherited members

class FileMoveSchema (*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = 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: Size GET

Time that the file move operation takes before cutover completes, in seconds.

Example: 8

destination: FileMoveFile GET POST PATCH

The destination field of the file_move.

elapsed_time: Size GET

Time elapsed since the start of the file move operation, in seconds.

Example: 100

failure: Error GET

Contains the most recent failure reason for move operation.

files_to_move: FileMoveFilesToMove POST

The files_to_move field of the file_move.

index: Size GET

An additional unique element identifying one file among many that could possibly be moved as part of a job. File index is an identifier ordered by the file path arrays provided during create. For file move operations that involve only one file, the file-index value of zero is always correct.

Example: 0

is_destination_ready: bool GET

Indicates whether the destination file is ready for use.

is_flexgroup: bool GET

Indicates whether this is a FlexGroup file move operation.

is_snapshot_fenced: bool GET

Indicates whether Snapshot copies are fenced.

max_cutover_time: Size GET POST

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. Not supported in FlexGroup volume file move operations.

Example: 10

max_throughput: Size GET POST

Maximum amount of data, in bytes that can be transferred per second in support of this operation. A non-zero value less than 1 MB/s is set to 1 MB/s. A non-zero value greater than 1 MB/s is truncated to the nearest integral megabyte value. If unspecified, the default value is "0" which means no range is set for the data transfer.

Example: 250000

node: Node GET POST PATCH

The node field of the file_move.

reference: ReferenceFileMoveFile POST

The reference field of the file_move.

scanner: FileMoveScanner GET POST PATCH

The scanner field of the file_move.

source: FileMoveFile GET POST PATCH

The source field of the file_move.

svm: Svm GET

The svm field of the file_move.

uuid: str GET

The UUID which uniquely identifies the job that started this move operation.

Example: 4fcb3159-a4ee-42b5-bb16-f752f2c430fc

volume: Volume GET

The volume field of the file_move.