New to NDMSDK and using Zeplorer to look at the code. If am executing the code, sprintf() is displaying all the code in xml but like to have the values in dictionary/provide a specific attribute with print statement to check the value for the attribute.
In this case, am trying to retrieve bais aggr name.
Have seen return parameters this call is providing and how and which call to retrieve the information in a string so that can use use loop consitions.
Here the script:
import sys
sys.path.append("/root/nmsdk54/netapp-manageability-sdk-5.4/lib/python/NetApp")
from NaServer import *
s = NaServer("filername", 1 , 19)
s.set_server_type("FILER")
s.set_transport_type("HTTP")
s.set_port(80)
s.set_style("LOGIN")
s.set_admin_user("username", "password")
api = NaElement("aggr-list-info")
api.child_add_string("aggregate","aggr1_thin")
xi = NaElement("filter-attrs")
api.child_add(xi)
xi1 = NaElement("filter-attrs-info")
xi.child_add(xi1)
xi1.child_add_string("all","<all>")
xi1.child_add_string("is-cfo","<is-cfo>")
xi1.child_add_string("is-local","<is-local>")
xi1.child_add_string("is-partner","<is-partner>")
xi1.child_add_string("is-sfo","<is-sfo>")
xo = s.invoke_elem(api)
if (xo.results_status() == "failed") :
print ("Error:\n")
print (xo.sprintf())
sys.exit (1)
print ("Received:\n")
#print (s.xo.sprintf())
out=xo.child_get("aggregates")
out1=xo.child_get("attributes-list")
print (out)
print (out1)
output of the script is:
# python aggr.py
Received:
<NaElement.NaElement instance at 0x2ae2a419fbd8> -> What does this mean and how to retieve a value?
None