Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
hi,
I'm trying to extract my active network config from my FAS (7Dot) using NMSDK 5.4 with net-config-get-active.
It works well except for vlan. vlanid stay at 0 for every vlan. Do i miss something ?
Thanks for your help.
What version of ONTAP are you running?
Did a quick test and I get a VLAN section beside the interfaces section that lists the VLANs.
import sys sys.path.append("netapp-manageability-sdk/lib/python/NetApp")
from NaServer import *
s = NaServer("10.78.7.100", 0 , 30) s.set_server_type("FILER") s.set_transport_type("HTTP") s.set_port(80) s.set_style("PASSWORD") s.set_admin_user("ontapi","Netapp01") result = s.invoke_elem(NaElement("net-config-get-active")) print result.sprintf()
Result :
<results status="passed"> <net-config-info> <ifgrps></ifgrps> <vlans> <vlan-info> <interface-name>e0a-100</interface-name> <parent-interface>e0a</parent-interface> <gvrp-enabled>false</gvrp-enabled> <vlanid>100</vlanid> </vlan-info> </vlans> <interfaces> [...] </interfaces> <routes> [...] </routes> <config-status></config-status> </net-config-info> </results>
I'using ontapi 21 witch Netapp 8.2.4P7 7-mode
import sys sys.path.append("<path_to_nmsdk_root>/lib/python/NetApp") from NaServer import * s = NaServer("FAS82A", 1 , 21) s.set_server_type("FILER") s.set_transport_type("HTTP") s.set_port(80) s.set_style("LOGIN") s.set_admin_user("superv", "<password>") 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()) api1 = NaElement("system-get-version") xo1 = s.invoke_elem(api1) if (xo1.results_status() == "failed") : print ("Error:\n") print (xo1.sprintf()) sys.exit (1) print ("Received:\n") print (xo1.sprintf()) api2 = NaElement("net-config-get-active") xo2 = s.invoke_elem(api2) if (xo2.results_status() == "failed") : print ("Error:\n") print (xo2.sprintf()) sys.exit (1) print ("Received:\n") print (xo2.sprintf())
<results status='passed'> <major-version>1</major-version> <minor-version>21</minor-version> </results> <results status='passed'> <version>NetApp Release 8.2.4P2 7-Mode: Mon Feb 1 11:30:11 PST 2016</version> <is-clustered>false</is-clustered> </results> <results status='passed'> <net-config-info> <ifgrps> <ifgrp-info> <interface-name>iFAS82A-NAS</interface-name> <ifgrp-type>lacp</ifgrp-type> <ifgrp-policy>ip</ifgrp-policy> <links> <link>e1a</link> <link>e1b</link> </links> </ifgrp-info> </ifgrps> <vlans> <vlan-info> <interface-name>iFAS82A-NAS-156</interface-name> <parent-interface>iFAS82A-NAS</parent-interface> <gvrp-enabled>false</gvrp-enabled> <vlanid>0</vlanid> </vlan-info> </vlans>
I did some tests and was able to reproduce your problem.
It looks like the API parses the interface name up to the first "-" character and determines the VLAN with what follows.
If you have a "-" character in your interface name it doesn't work.
Here with "test-ifgrp" :
<results status="passed"> <net-config-info> <ifgrps> <ifgrp-info> <interface-name>test-ifgrp</interface-name> <ifgrp-type>single</ifgrp-type> <ifgrp-policy>single</ifgrp-policy> <links> <link>e0c</link> <link>e0d</link> </links> </ifgrp-info> </ifgrps> <vlans> <vlan-info> <interface-name>test-ifgrp-100</interface-name> <parent-interface>test-ifgrp</parent-interface> <gvrp-enabled>false</gvrp-enabled> <vlanid>0</vlanid> </vlan-info> </vlans> <interfaces> [...] <interface-config-info> <interface-name>test-ifgrp</interface-name> <ipspace-name>default-ipspace</ipspace-name> <mac-address>02:0c:29:3f:83:81</mac-address> </interface-config-info> <interface-config-info> <interface-name>test-ifgrp-100</interface-name> <ipspace-name>default-ipspace</ipspace-name> <mac-address>02:0c:29:3f:83:81</mac-address> </interface-config-info> </interfaces> <routes> [...] </routes> <config-status></config-status> </net-config-info> </results>
Here with "testifgrp"
<results status="passed"> <net-config-info> <ifgrps> <ifgrp-info> <interface-name>testifgrp</interface-name> <ifgrp-type>single</ifgrp-type> <ifgrp-policy>single</ifgrp-policy> <links> <link>e0c</link> <link>e0d</link> </links> </ifgrp-info> </ifgrps> <vlans> <vlan-info> <interface-name>testifgrp-100</interface-name> <parent-interface>testifgrp</parent-interface> <gvrp-enabled>false</gvrp-enabled> <vlanid>100</vlanid> </vlan-info> </vlans> <interfaces> [...] <interface-config-info> <interface-name>e0c</interface-name> <ipspace-name>default-ipspace</ipspace-name> <mac-address>02:0c:29:3f:83:81</mac-address> <mediatype>auto-1000t-fd-up</mediatype> <flowcontrol>full</flowcontrol> </interface-config-info> <interface-config-info> <interface-name>e0d</interface-name> <ipspace-name>default-ipspace</ipspace-name> <mac-address>02:0c:29:3f:83:81</mac-address> <mediatype>auto-1000t-fd-up</mediatype> <flowcontrol>full</flowcontrol> </interface-config-info> <interface-config-info> <interface-name>testifgrp</interface-name> <ipspace-name>default-ipspace</ipspace-name> <mac-address>02:0c:29:3f:83:81</mac-address> </interface-config-info> <interface-config-info> <interface-name>testifgrp-100</interface-name> <ipspace-name>default-ipspace</ipspace-name> <mac-address>02:0c:29:3f:83:81</mac-address> </interface-config-info> </interfaces> <routes> [...] </routes> <config-status></config-status> </net-config-info> </results>
Thanks you very much ! it's sad that i can't change ifgrp name in production.
I have no luck with this net api. I found a bug in net-config-get-persistent which do not seem to support FC-IV card...