Software Development Kit (SDK) and API Discussions

api version not correct

swamik
2,157 Views

My Netapp filers are running 9.1p5, python version is 3.7.3 and NMSDK version is 9.4. When i run the following python script, it gives me the error and the error message is given below at the end. My guess is that i am not using the correct api version in the script. Can anyone help me with the solution to the problem ? - error message

from NaServer import * s=NaServer("",1,130)

s.set_server_type("FILER")

s.set_transport_type("HTTPS")

s.set_port(443) s.set_style("LOGIN")

s.set_admin_user("USER_NAME", "PASSWORD")

api=NaElement("system-get-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())

the error message is given below:

 

<results status="failed" reason="[Errno 0] Error" errno="13001"></results>

2 REPLIES 2

gaurav_verma
2,086 Views

I see two errors in your script 

>> from NaServer import * s=NaServer("",1,130)

should be 

from NaServer import *

s=NaServer("",1,130)

Second, 

>>s.set_port(443) s.set_style("LOGIN")

should be 

s.set_port(443)

s.set_style("LOGIN")

 

To check which API version you should use, run this API to check 

>>api = NaElement("system-get-ontapi-version")

swamik
2,034 Views

Thanks for your reply.  I have fixed the script and it is working now.

 

I have another problem, i am trying to print the volume name and aggregate name.  But the the print command is not aligning the output. I need to have output in two columns.   At the moment i am getting the output in columns but not aligned properly.

I am using python 3.7.

 

I need some help to get the output in two columns with proper alignment or indentation.

Public