Software Development Kit (SDK) and API Discussions

How to get major and minor No. info for NetApp array

neha_T
3,229 Views

i am using NMSDK with python. I am using below script

when i run the below script with major:minor no 1:32 it works fine

<script>

import sys
sys.path.append("./NetApp")
from NaServer import *
s = NaServer("array", 1 , 32)
s.set_server_type("FILER")
s.set_transport_type("HTTPS")
s.set_port(443)
s.set_style("LOGIN")
s.set_admin_user("vsadmin", "pass")
api = NaElement("system-get-ontapi-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())

<script>

 

But for same script when i pass major:minor no as:

 

s = NaServer("array-ip", 1 , 130) - > here 1:130 is major:minor no. 

it gives error:

<results status="failed" errno="13010" reason="Version 1.130 was requested, but only 1.32 is supported."></results>

 

so, How can i get the supported major and minor no for Array

5 REPLIES 5

gaurav_verma
3,209 Views

@neha_T

I have a standard Python class which has functions for all version. In my environment we have standard ONTAP version so it is easy to identify geneally but if you have multiple version of ONTAP, I suggest to have one class with multiple functions in it for multiple version. 

In your main script, use API failure message i.e. if there is failure then your other function and keep doing so until failure message does not go away. 

 

Hope this helps. 

neha_T
3,175 Views

@gaurav_verma

 

yes i get your point. is there any documentation for this major:minor no. combination

actually i m writing a generic script with NMSDK so for every array it can handle the version and provide the output despite of failure. or any command through which we can get the major and minor version?

gaurav_verma
3,145 Views

@neha_T No I am not aware of any such document. 

neha_T
3,112 Views

@gaurav_verma

thanks for your inputs

i want to know one more thing 

s = NaServer("array", 1 , 32) --> 1, 32 is major and minor no of appliance 

I am getting this major and minor no. through zapi "system-get-ontapi-version", but is there any command through which i can get the same details on cluster/node ???

gaurav_verma
3,091 Views

I  think there is no such command as well. 

Public