Hi,
I'm trying to list files in a directory. It's ok when i use curl but i have error when using python netapp-ontap.
I'm using the snippet in the documentation, i get this error with netapp-ontap 9.12.10rc1, 9.11.0, 9.10.1.0. :
raise NetAppRestError(
netapp_ontap.error.NetAppRestError: Received more than one record in the response FileInfo.
Code :
import logging
from netapp_ontap import HostConnection, NetAppRestError, config, utils
from netapp_ontap.resources import Volume,FileInfo
logging.basicConfig(level=logging.DEBUG)
utils.DEBUG=1
config.CONNECTION = HostConnection('XXXXX', 'xxxx', 'xxx',verify=False)
volume = Volume.find(**{'svm.name': "VSERVER", 'name': "volume_name"})
mypath="dir1/dir2/dir3"
res=FileInfo(volume.uuid, path=mypath)
res.get()
I've tried to use get_collection but the called url is not good :
GET /api/storage/volumes/0c692b41-yyyyy/files?dir1%2Fdir2%Fdir3 instead of
GET /api/storage/volumes/0c692b41-yyyyy/files/dir1%2Fdir2%Fdir3