Software Development Kit (SDK) and API Discussions
i am using NetApp python NMSDK 9.4
when i try to get information of lun , some time it is passing and most of the time i am getting below error
Zapi::parse_xml - Expected <netapp> element but got reason" errno="13001
<results status="failed" reason="Zapi::parse_xml - Expected <netapp> element but got volume-errors" errno="13001"></results>
how can i resolve this
See The Solution
Naserver Class is perhaps not thread safe. Try to create Naserver for each call.
View solution in original post
Check if you are using the correct version of API with correct ONTAP version.
You specify API version here.
s = NaServer("XXXXXXXXX", 1 , 130) this is for API version 1.130.
To check API version for that ONTAP use
api = NaElement("system-get-ontapi-version")
is there any way through NMSDK script through which i can get the API-version
i am using below script but to get the output API version is required.
import syssys.path.append("<path_to_nmsdk_root>/lib/python/NetApp")from NaServer import *
s = NaServer("--ip--", 1 , 130) --> apiversion is specifieds.set_server_type("FILER")s.set_transport_type("HTTPS")s.set_port(443)s.set_style("LOGIN")s.set_admin_user("vsadmin", "<password>")api = NaElement("system-get-ontapi-version")
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())
How can i get apiversion?
You can use any API version but still this API "system-get-ontapi-version" will give you correct API version.
May I have details of your code?
i have written a function which get the lun info for specified "serial-number".
it is working fine, but when i tried to fetch multiple lun-info in multi-threaded environment. some threads are successful to fetch info. while some fail with the error i mention:
@gaurav_verma i have specified the on-tap version also: server = NaServer(ip, 1 , 32)
results status="failed" reason="Zapi::parse_xml - Expected <netapp> element but got volume-error" errno="13001">
Did you tried to limit the number of threads you launch and start with a small number.
The Netapp api queue is limited, perhaps you reach this limit.
Try as well to create self.serverobj in the function as a local object Naserver, In your case you use the same Naserver for each thread.
yes i m using semaphore of count 10
for NaServer object i am using below senario:
yes it worked when i try to create NaServer object for each api call
Live Chat, Watch Parties, and More!
Engage digitally throughout the sales process, from product discovery to conﬁguration, and handle all your post-purchase needs.