And there is an example in the docs, and the comments within the netapp python library that tells you to do this from python like this:
from netapp_ontap import HostConnection
from netapp_ontap.resources import FileInfo
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FileInfo(
resource.path = "alice/bob/charlie.txt"
BUT this fails with
Caused by HTTPError('500 Server Error: Internal Server Error for url: https://server.domain:443/api/storage/volumes/7da9eb81-6daa-4323-9eab-7bbce73da0f2/files/%2Falice%2Fbob'): Failed to rename "/alice/bob" to
"/alice/bob/charlie". Reason: Invalid argument
The library correctly detects that path has changed and makes the body of the REST API request, but it fails to append the filename to the URL and thus is trying to rename the directory containing the file, rather than the file itself.
By the way, in the docs the import also should read
from netapp_ontap.host_connection import HostConnection
So I think this is a bug in the netapp-ontap Python Library