Software Development Kit (SDK) and API Discussions

Errno 61 - connection refused - NMSDK 5.6 Python

AJ
NetApp
3,974 Views

Not a full time programmer, but trying my hand at NetApp APIs. I'm getting connection refused when connecting to CDOT filer using SDK 5.6. 

 

 

filer = sys.argv[1]
user = sys.argv[2]
password = sys.argv[3]

s = NaServer(filer, 5, 6)
s.set_server_type("Filer")
s.set_admin_user(user, password)
s.set_transport_type("HTTP")
output = s.invoke("system-get-version")

if(output.results_errno() != 0):
r = output.results_reason()
print("Failed: " + str(r))

else :
r = output.child_get_string("version")
print(r + "\n")

 

User@~/PycharmProjects/Training$ python template.py my.ip admin my.password
Failed: [Errno 61] Connection refused

 

I am using the admin user and password and connecting to the cluster mgmt IP address. Looking for some advice. Thanks!

 

 

 

1 ACCEPTED SOLUTION

asulliva
3,967 Views

Hello @AJ,

 

A few things to test/check.

 

  1. The ZAPI version should be 1.X, with the X being dependent on the version of ONTAP you're using.  For example, ONTAP 9 = 1.100, 9.1 = 1.110.  You'll want to change the NaServer object to look something like this:  
    s = NaServer(filer, 1, 100)

     

  2. Try and echo/print out the filer, user, and password variables.  Make sure they are equal to what you expect them to be.
  3. Ensure that HTTP access is enabled on your cluster for the interface you're connecting to.
  4. Ensure the user you're using has ONTAPI access granted (though I don't think this is the issue, you would get a different error).

Hope that helps!

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

1 REPLY 1

asulliva
3,968 Views

Hello @AJ,

 

A few things to test/check.

 

  1. The ZAPI version should be 1.X, with the X being dependent on the version of ONTAP you're using.  For example, ONTAP 9 = 1.100, 9.1 = 1.110.  You'll want to change the NaServer object to look something like this:  
    s = NaServer(filer, 1, 100)

     

  2. Try and echo/print out the filer, user, and password variables.  Make sure they are equal to what you expect them to be.
  3. Ensure that HTTP access is enabled on your cluster for the interface you're connecting to.
  4. Ensure the user you're using has ONTAPI access granted (though I don't think this is the issue, you would get a different error).

Hope that helps!

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public