Hi community,
I was trying to use the Python API to query a list of files on a specific volume on a specific vserver, so far i have been successfully able to do that using the powershell command:
Read-NcDirectory /vol/volume0 -VserverContext nfs_test | where {$_.Type -match "directory" -and $_.Name -notmatch "\."} | Read-NcDirectory
However, when I try to accomplish a similar task using the python API:
import sys
sys.path.append("C:\sdk\lib\python\NetApp")
from NaServer import *
s = NaServer("10.0.0.1", 1 , 20)
s.set_server_type("FILER")
s.set_transport_type("HTTPS")
s.set_port(443)
s.set_style("LOGIN")
s.set_admin_user("admin", "password")
api = NaElement("file-list-directory-iter")
api.child_add_string("encoded",True)
api.child_add_string("path","/vol/volume0")
xo = s.invoke_elem(api)
if (xo.results_status() == "failed") :
print ("Error:\n")
print (xo.sprintf())
sys.exit (1)
print "Received:\n"
print xo.sprintf()
I get the following output:
Error:
<results status="failed" errno="13005" reason="Unable to find API: file-list-directory-iter-start"></results>
Has anyone been able to accomplish this? My main task is to verify all .vmdk and .qcow files inside a specific volume and check its QoS policy, if there's none I must be able to add one.
Any tips? Any hints? Anything?