Simple announcement :
http://dev.tynsoe.org/ybizeul/netapp-scripts/tree/master
Feel free to comment if you are interested in the initiative.
Purpose
NetApp Manageability SDK (NMSDK) is provided by NetApp to let third party ddevelopment and scripts to interract with NetApp storage components (cDOT clusters, 7-mode controllers, OnCommand Unifued Manager, DFM).
The SDK provided by NetApp is essentially a wrapper around the XML protocol used to exchange informations over HTTP(s). It means you essentially have to build a structure of NaElements (in essence representing XML nodes) implementing the required elements and children documented for each call.
It leads to code hard to read and maintain, mostly spent in building NaElements and stick them together instead of performing straightforward API calls.
NetAppObject.py is a module that lets you simplify your code and develop more efficiently with NetApp APIs. For example, to get the name of a NetApp cluster, the traditional way is the following code :
"s" is a previously created NaServer object
cluster_identity_get = NaElement("cluster-identity-get")
desired_attributes = NaElement("desired-attributes")
cluster_name = NaElement("cluster-name")
cluster_identity_get.child_add(desired_attributes)
desired_attributes.child_add(cluster_name)
result = s.invoke_elem(cluster_identity_get)
cluster_name = result.child_get("attributes").child_get("cluster-identity-info").child_get_string("cluster-name")
print cluster_name
Using NetAppObject:
result = NetAppObject.invoke(s,{"cluster-identity-get": {"desired-attributes": {"cluster-name"}}})
cluster_name = result["results"]["attributes"]["cluster-identity-info"]["cluster-name"]
print cluster_name
Or even easier:
result = Cluster(s)
print result.cluster_name