Python Discussions

samples not working




I am a new netapp sdk user. I am trying to execute some Python samples that are included with the SDK. I always get the error 'unable to find api. Are there tutorials or manuals for beginners available?


Best regards



"unable to find api" generally occur when API and ONTAP version does not match.

In python check this syntax s = NaServer(filer_name, 1 , 32). 1,32 here is API verison 1.32 and different versions have different API version support. For example for Cluster mode it should be s = NaServer(filer_name, 1 , 32) and for 7 mode s = NaServer(filer_name, 1 , 21)


Long time python hacker, new to netapp as well.  Check the perl docs for cDOT api references ( doc/perldoc/OntapClusterAPI.html ) just remeber that the calls for perl are things like system_api_list you would actually be the api call 'system-api-list' so  `s.invoke('system-api-list')` or `s.invoke_elem(NaElement('system-api-list', ''))`.  If you need to pass paramaters to a call it's just `s.invoke(api, parameter1, value1, parameter2, value2, ...)` 


A lot of calls end in `get-iter` which all follow the same pattern of needing the tag recycled to fetch more.  Here is one example.


Be careful there since setting the version to 1,3 will preclude you setting the vserver... you need 1,15 or higher to set the vserver.  The code itself is not very clean and is very ugly, I've started to put wrappers around the NetApp code to simplify things.


If you want there is a full set of all API references in a javadoc style format stored in the jar file for zexplore ( unzip zexplore.jar and look in the doc folder. )

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner